I have a text file with 9267 lines. I want to find "A" with 5 spaces after it and replace it with "A" with 5 spaces before and after it on all lines, but only between columns 67 and 88. Text outside of those columns needs to be excluded. I'm hoping
awk can be of help here, though I don't know how to use them very well.
Details: I'm converting a 128 page PDF into a spreadsheet. I used PDFedit to save the PDF as a text file. I'm planning to use LibreOffice to Insert a "Sheet from File". That's proving to be difficult because while the columns in the PDF line up well, the spreadsheet-type columns aren't in quite the same text-file-type column throughout the text file. Every 50 lines or so is analogous to a different PDF page, and that's where a spreadsheet-type column might move a few text-file-type columns to the left or right. In other words, the spreadsheet-type column for "Shelf" might start on text-file-type column 70 in one part of the file, but start on text-file-type column 76 in another part. That makes it so the spreadsheet-type columns overlap when I try to do a "Fixed Width" Insert into LibreOffice. I want to make the columns more spread out by adding spaces via find and replace so I can tell LibreOffice where to define the columns. If I find and replace on the whole file, I end up putting spaces where I don't want them.
Here's an fairly accurate example:
Item Code Active Description Store Room Row Shelf Bin On Hand 38NUTZSL Y 3/8"-16 HEX ZINC NUT B 03 C 2 0 WELD-AL Y WELD, ALUM. ROD, STICK OR SPOOL A 01 B 2 68.25 08300 Y WASHER, 7/8 CASE HARDENED 29/32 ID,1 3/4 OD A 01 C 5 0