Search Results

Search: Posts Made By: HealthyGuy
19,635
Posted By HealthyGuy
Print lines with search string at specific position
Hi Folks,

I have a file with all fields defined by byte position, but any field can be empty so I cannot print lines based on a search of specific columns. I need to print all lines of this file...
6,591
Posted By HealthyGuy
You are correct, thanks Ygor! I was getting a...
You are correct, thanks Ygor! I was getting a syntax error as awk before so I altered it then changed it to nawk without replacing the changes i had made in awk. It does exactly what I need with a...
6,591
Posted By HealthyGuy
Nawk works better but still not 100%, the code is...
Nawk works better but still not 100%, the code is now:

nawk '{for(i=1;i<=length;i++)
printf((i>=1&&i<=3||i>=203&&i<=240||i>=260&&i<=289), substr($0,i,1))}' file_in > file_out

but my file in...
6,591
Posted By HealthyGuy
Thanks everyone, this last post from Ygor looks...
Thanks everyone, this last post from Ygor looks like the easiest option. I've been playing with it this morning but getting a syntax error I can't get past.

awk: syntax error near line 2
awk:...
6,591
Posted By HealthyGuy
Thanks everyone. my samples are simplified...
Thanks everyone.

my samples are simplified so what I actually have are lines 300 bytes long.

I need to print bytes 1-3, 203-240, and 260-289, with blank spaces between so the output remains in...
6,591
Posted By HealthyGuy
Hi Manish This does print the correct...
Hi Manish

This does print the correct positions but does not fill in the spaces between with the same number of bytes turned to blanks that were in the original. For example, if we take the...
6,591
Posted By HealthyGuy
Cut output to same byte position
Hi folks

I have a file with thousands of lines with fixed length fields:

sample (assume x is a blank space)

111333xx444TTTLKOPxxxxxxxxx

I need to make a copy of this file but with only...
158,521
Posted By HealthyGuy
Wildcards in SED
Hi Folks

Quick one I can't seem to figure out sed wildcards..

I need to replace a string such as "From here.....to here".

I would think the command would look like:
sed 's/From here*to...
Showing results 1 to 8 of 8

 
All times are GMT -4. The time now is 05:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy