Page 1 of 1

Extract data from txt to another document

Posted: Thu Dec 19, 2024 4:40 pm
by njfosforito
Hello,

I'm completely new to switch and waiting on training. Is it possible to pull information from a database into another? If so what do you think is the best way to process something like this?

it's a txt file I am receiving but I will need to pull specific columns and and or specific cells. Would it make sense to use JS CVS writer App? Does Javascript sound like the best way to use something like this to extract information.

Does jS also give the ability to format specific a column? Meaning if I need a column to include decimals, commas or date format will it alter the data if written correctly?

Thanks I appreciate any info/guidance that you guys can provide. If I am too vauge I can create some samples to show exactly what I mean if visually is more useful.

Re: Extract data from txt to another document

Posted: Fri Dec 20, 2024 9:08 am
by magnussandstrom
I think you would need to provide a more specific example for us to be able to offer you some guidance.

Re: Extract data from txt to another document

Posted: Fri Dec 20, 2024 9:23 am
by jan_suhr
If you have the Switch Scripting module you can easily do this.

With NodeJS in Switch there are all kinds of possibilities with the Scripting Module.

It uses NPM Packages that are available here: https://www.npmjs.com/ as scripting modules that you can adapt to the Switch environment.

The CSV format is useful in this case and there are plenty of NPM packages for that

Re: Extract data from txt to another document

Posted: Fri Dec 20, 2024 10:20 am
by tdeschampsBluewest
njfosforito wrote: Thu Dec 19, 2024 4:40 pm Hello,

I'm completely new to switch and waiting on training. Is it possible to pull information from a database into another? If so what do you think is the best way to process something like this?

it's a txt file I am receiving but I will need to pull specific columns and and or specific cells. Would it make sense to use JS CVS writer App? Does Javascript sound like the best way to use something like this to extract information.

Does jS also give the ability to format specific a column? Meaning if I need a column to include decimals, commas or date format will it alter the data if written correctly?

Thanks I appreciate any info/guidance that you guys can provide. If I am too vauge I can create some samples to show exactly what I mean if visually is more useful.
Hi, there are several app that can do this (CSV creator to edit a CSV file, CSV pickup to make basic request...).
However they may not be specific for your needs.

As said by other, if you give us more details, we can guide you to one app or another, or a some Npm modules tied for this.

Re: Extract data from txt to another document

Posted: Mon Dec 23, 2024 6:53 pm
by njfosforito
magnussandstrom wrote: Fri Dec 20, 2024 9:08 am I think you would need to provide a more specific example for us to be able to offer you some guidance.
Thank you for replying, so I would like extract specific rows. first row to create some form of header and anything following (row two could like to extract column A, B, J, C, and finally D into a new file.
I guess which app would work best of something similar to this
This is how it's provided
This is how it's provided
Screenshot 2024-12-23 at 12.30.17 PM.png (66.05 KiB) Viewed 10100 times
how i would like to extract
Screenshot 2024-12-23 at 12.32.52 PM.png
Screenshot 2024-12-23 at 12.32.52 PM.png (27.26 KiB) Viewed 10100 times
----
Apart from extraction request, I would like to make an additional file separate file, using what the client provided, where the highlighted is formatted. Is there a separate app that can do this as well?
This is how it's provided
This is how it's provided
Screenshot 2024-12-23 at 12.30.17 PM.png (66.05 KiB) Viewed 10100 times
Screenshot 2024-12-23 at 12.44.03 PM.png
Screenshot 2024-12-23 at 12.44.03 PM.png (56.36 KiB) Viewed 10100 times
one column is comma, one is moving decimal by 2 places, date, and zipcode +4

Hopefully this can help

Re: Extract data from txt to another document

Posted: Mon Dec 30, 2024 9:10 am
by magnussandstrom
I would use 'Easy Data Transform' to do this in Switch. The first file is a piece of cake. The second file could be a bit more challanging, but I think it is possible with 'Easy Data Transforms' as well.

Re: Extract data from txt to another document

Posted: Fri Jan 10, 2025 3:36 pm
by njfosforito
thank you I will try this out!