This question is not a duplicate as someone had suggested. Mods, pay attention
I'm running a for loop on multiple files that contain information like below
1 Leer Normal [status] — 100
1 Wrap Normal [physical] 15 90
4 Poison Sting Poison [physical] 15 100
9 Bite Dark [physical] 60 100
12 Glare Normal [status] — 100
17 Screech Normal [status] — 85
20 Acid Poison [special] 40 100
25 Spit Up Normal [special] — 100
25 Stockpile Normal [status] — —
25 Swallow Normal [status] — —
28 Acid Spray Poison [special] 40 100
33 Mud Bomb Ground [special] 65 85
36 Gastro Acid Poison [status] — 100
38 Belch Poison [special] 120 90
41 Haze Ice [status] — —
44 Coil Poison [status] — —
49 Gunk Shot Poison [physical] 120 80
I need to be able to extract data from it.
The problem is, each file has different column lengths.
Column 2 sometimes has spaces in it so squeezing all spaces and using space as a delimiter for cut is not an option. I need the columns separated by tabs without using specific information because the loop goes over about 800 files.
sed 's/ \+/ /g' | cut -f 2 -d " "
^ Not what I need since column 2 has spaces in it
cut -b "5-20"
^ Can't use this either because the columns lengths are different for each file.