I have a .csv file that has some values formatted as paragraphs with line breaks or sometimes bullet points.
"STAT","ID","DESC"
"UPD", "1", "Updated"
"CHG", "2", "Changed"
"UPD", "3", "Updated.
Might have to update again"
"UPD", "4", "Updated.
- once
- twice
- thrice
"
"DEL", "5", "unknown"
"DEL", "6", "Deleted
Need to restore"
I need to count the number of records, used awk like below since I knew 2nd column is unique id but returns more than I have. Above text is ofcourse dummy as I'm not allowed to share original but I tried to reflect as closely as I can.
awk '{print $2}' FS="," sample.csv | wc -l
I even printed out first column using awk '{print $1}' to check just the first column values but the output shows the starting parts of new line in paragraphs.
Please let me know if any additional info is needed and I'll update the question.