Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline chris.hill@adsigroup.co.uk  
#1 Posted : Friday, July 19, 2019 1:15:48 PM(UTC)
chris.hill@adsigroup.co.uk

Rank: Paid support

Joined: 3/28/2018(UTC)
Posts: 16

Thanks: 4 times
Was thanked: 1 time(s) in 1 post(s)
Hi

I want to read through a fixed format text file a line at a time so I can then import the data into a SQL database.

I can't work out how to open the file and read each line in turn / within a loop? The read file obviously takes the whole content, what do I need to do please to loop through the file one line at a time?

Thanks
Offline Support  
#2 Posted : Friday, July 19, 2019 2:38:32 PM(UTC)
Support

Rank: Official support

Joined: 12/1/2015(UTC)
Posts: 96

Thanks: 15 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: chris.hill@adsigroup.co.uk Go to Quoted Post
Hi

I want to read through a fixed format text file a line at a time so I can then import the data into a SQL database.

I can't work out how to open the file and read each line in turn / within a loop? The read file obviously takes the whole content, what do I need to do please to loop through the file one line at a time?

Thanks


Hi Chris,

What you need is a specific variable to type in to the SQL task, this one for example; {LOOP(CurrentValueXArray|0)}
You can find that when you go to Variables -> Jobs -> Active Jobs -> Loop.
We have a youtube tutorial that shows an example of almost exactly what you want to do. You can find it here:

Edited by user Friday, July 19, 2019 3:57:15 PM(UTC)  | Reason: Not specified

Michael
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Online Gary_W  
#3 Posted : Friday, July 19, 2019 2:43:52 PM(UTC)
Gary_W

Rank: Paid support

Joined: 12/19/2016(UTC)
Posts: 193
United States
Location: Michigan, Dearborn

Thanks: 41 times
Was thanked: 66 time(s) in 57 post(s)
Unless you have special reason for line-at-a-time reading, use the bulk loading tools for your RDBMS to load data into tables. Performance will be much faster. Use VC for detecting a file arrived, then call the bulk loader utility.
thanks 1 user thanked Gary_W for this useful post.
Support on 7/19/2019(UTC)
Users browsing this topic
Guest (2)
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Scroll to Top