So, I have a file that contains several fields separated by a pipe. When deciding whether to copy the current line into a new file, I only want to test to see if the value of the first field matches the value in the first field of the line before it. I can do a File Iterator, but then I cannot take a Substring on the current line up to the first pipe because Substring either requires two indices (starting and ending) or two strings (starting and ending). What I want is to take a substring from index 0 to the first occurrence of the pipe and put that into a variable.
So, I try a CSV iterator. This will work if I set a variable equal to every field value in the line, and then recreate the line with all of the pipes and variables when I want to copy the line to the new file. But I don’t need variables for all of the fields, and it seems like a lot of overhead.
What am I missing? Is there a way to do a File Iterator but find the value of the first field on each line? Or do a CSV Iterator, but set a variable to the entire current line so that I can write that variable to the new file?
After all these years of using and liking Automise, I feel like there is some trick I should be able to use, but I cannot think of what it would be. Any help is appreciated.