Hi all,
I have the following script to read the second columns of each line and printing those columns to the separate files such as 1.txt, 2.txt etc.
value = 1;
BEGIN { RS = "\n" } ;
{
while(getline > 0){
filename = (value ".txt");
print $2 >> filename;
value = value + 1;
}
}
However, this script always skips the first line for the following file content if I don't put a empty line at the very beginning (but I don;t wanna do that). How can I fix this problem? Thank you very much.
vidWos6D 0
GCYlRuPA 355
rDLWdHPV 128
RH8ucXOb 552
qCUtKgfd 380
I have the following script to read the second columns of each line and printing those columns to the separate files such as 1.txt, 2.txt etc.
value = 1;
BEGIN { RS = "\n" } ;
{
while(getline > 0){
filename = (value ".txt");
print $2 >> filename;
value = value + 1;
}
}
However, this script always skips the first line for the following file content if I don't put a empty line at the very beginning (but I don;t wanna do that). How can I fix this problem? Thank you very much.
vidWos6D 0
GCYlRuPA 355
rDLWdHPV 128
RH8ucXOb 552
qCUtKgfd 380