Search Results

Search: Posts Made By: jbt828
2,178
Posted By jbt828
Thanks DG... it worked
Thanks DG... it worked
2,178
Posted By jbt828
Moving bytes in file by offset and length
Hi,
I'm looking for a way (other than C) to pull out a number of bytes in a Linux file for a giving length. for example:

file1 contains 2 records:
abcdefghijkl
mnopqrstuv
.....
so, I want to...
32,788
Posted By jbt828
Thanks everyone for your suggestions... all of...
Thanks everyone for your suggestions... all of them worked
32,788
Posted By jbt828
Grep command to count characters
I have a file that I need to count the number of "Y"s in the file, but just the "Y"s that fall between certain columns. Like:

file1:
1234567890123456789012345
BBBBBBYBBBBYBBYBBYBBYBBB

I...
2,237
Posted By jbt828
Thank Guys! I'm doing some testing. Looks like it...
Thank Guys! I'm doing some testing. Looks like it works for the first occurance in the file when the cnt=0, but when I change the... if cnt=="1" then the second does not get change... I'll do more...
2,237
Posted By jbt828
Awk ignoring variable
If anyone knows why $cc is ignored in the following awk.
When I use a value it works ok.
cc=`grep -a "ControlID" in.file | cut -c 375-378`

$cc is equal to "XXXX"

does not work:
cat...
3,983
Posted By jbt828
no error messages. nothing happens, looks like it...
no error messages. nothing happens, looks like it can't find 'Control ID".

When I run this on a small file it works. Could be end of line characters.. not sure.

Background:
This is a AFP file...
3,983
Posted By jbt828
Thanks Scott! that worked.. ---------- Post...
Thanks Scott! that worked..

---------- Post updated at 11:12 AM ---------- Previous update was at 09:26 AM ----------

when I try to run this on my production file it does not work. I think it's...
3,983
Posted By jbt828
This works, but replaces with 1 space not 4 spaces
Scott,

the command works ok, but 1 space replaces 4 bytes which compresses the file:

sed "s/\(.*\)....\(.\{7\}Control ID.*\)/\1 \2/"

In:
abcde****1234567Control ID890

to:
abcde...
3,983
Posted By jbt828
thanks a lot..
thanks a lot..
3,983
Posted By jbt828
search for string and replace backwards
I'm new to Unix scripting and I'm not sure if this can be done. Example:

search (grep) in a file for 'Control ID' and then replace with 4 blanks 7 bytes before 'Control ID.

input...
Showing results 1 to 11 of 11

 

Featured Tech Videos

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