Splitting a file more than 30 GB size with specific condition

Ask a question Vikram Kanse - Last answered on Apr 7, 2017 at 04:56 PM by ac3mark
I have a file name "xzy.dat". It is of size more than 30 GB.

The content of file would be something like this

12345678 244466 2017101820171021 00077898 00011111 00022222

Above record is a bad record. A normal record would look something like this

12345678A244466 2017101820171021 00077898 00011111 00022222

If u observe, there's an alphabbet "A"(or any other character) missing from the first example line that i provided at 9th Position. That's clearly wrong. Instead there's a space in that line.

I want to split my 30 GB file in two files in such a way that any string which has a space in that position (9th Position) should be moved to a different file and rest of the good records to another file.

Can this be done? If yes, can you please guide me to do so.

Thank You,
plus moins
Where did the records come from? Can you open and view it notepad?

Of course you can analyze the file in a powerscript and make the changes. I am not prepared to auther this script for you, as it is inevitable that it will not work as you wish for it to, or it won't do a certain detail that you failed to mention, and I will have to keep working on it. For this reason, we do not provide turn key solutions.

If you wish to post some code and get help from that, I encourage you to go that route!
Leave a comment

Member requests are more likely to be responded to.

Members can monitor the statuses of their requests from their account pages.

A CCM membership gives you access to additional options.

Not a member yet?

Sign up now. It takes less than a minute and is completely free!