Hi,
I am trying to execute a series of nested for loops one at a time so that the inner for loops happen once each time the outer for loop is run through.
To give a bit more context I have a PDF file which is 58 pages long. Every two pages is an individual document that I want to seperate and open a new table for using the text import wizard (so 29 documents sandwhiched together in one PDF). I also want to have the column names start at the 32nd line and the data start at the 33rd line of each two page document.
To do this I have nested for loops at Column Names Start and Data Start in the text wizard script. There is 134 lines between the column names on each of the 29 documents, and subsequently 134 lines between were the data starts on each of the 29, 2 page long, documents.
There is also a for loop around the entire script to open the main file 29 times, with the subsequent for loops choosing which line to start and and make a table for each document sandwhiched in the file.
How would I use the Break or Continue command to have the script execute the first for loop once, get to the next for loop and have it execute once, then continue down the script executing each for loop only once before starting again at the top of the file and going through the next iteration of the for loop? While also having each for loop remember the past iteration to keep the line count where it should be.
Thank you,
Matt
//opens text file using text wizard
for(i=1, i<=29, i++,
Open(
"C:\Users\file.txt",
columns(
New Column( "Parameters", Character, "Nominal" ),
New Column( "Results", Character, "Nominal" ),
New Column( "Units", Character, "Nominal" ),
New Column( "Uncertainty", Character, "Nominal" ),
New Column( "Spec", Character, "Nominal" ),
New Column( "Methods", Character, "Nominal" ),
New Column( "c000007", Character, "Nominal" ),
New Column( "c000008", Character, "Nominal" ),
New Column( "c000009", Character, "Nominal" ),
New Column( "c0000010", Character, "Nominal" ),
New Column( "c0000011", Character, "Nominal" ),
New Column( "c0000012", Character, "Nominal" ),
New Column( "c0000013", Character, "Nominal" ),
New Column( "c0000014", Character, "Nominal" ),
New Column( "c0000015", Character, "Nominal" ),
New Column( "c0000016", Character, "Nominal" ),
New Column( "c0000017", Character, "Nominal" ),
New Column( "c0000018", Numeric, "Continuous", Format( "Best", 10 ) )
),
Import Settings(
End Of Line( CRLF, CR, LF ),
End Of Field( Space, CSV( 0 ) ),
Strip Quotes( 1 ),
Use Apostrophe as Quotation Mark( 0 ),
Use Regional Settings( 0 ),
Scan Whole File( 1 ),
Treat empty columns as numeric( 0 ),
CompressNumericColumns( 0 ),
CompressCharacterColumns( 0 ),
CompressAllowListCheck( 0 ),
Labels( 1 ),
Column Names Start(
for(q=1, q<=29, q++,
(32*q)+for(p=135, p<29, p++,
(show(p));
);
);
),
Data Starts(
for(t=1, t<=29, t++,
(33*t)+for(s=135, s<29, s++,
(show(s));
);
);
),
Lines To Read( "135" ),
Year Rule( "20xx" )
)
));