Search Results

Search: Posts Made By: wvdeijk
2,452
Posted By wvdeijk
Parsing a fixed column text file in sed
I have a text file with records of the form:
A X1 Y1 X2 Y2 X3 Y3
where A is character length 10, Xi is character length 4 and Yi is numeric length 10.

I want to parse the line, and output...
5,480
Posted By wvdeijk
Thanks. As you say, that wouldn't look very...
Thanks. As you say, that wouldn't look very nice. I tried to be a bit creative, and it actually worked:D


FIELDWIDTHS1="8 8 18 1 15 6 10 1 8 1 1 3 12 7 9 10 8 2 2 4 8 10 3 2 1 3 3 2 2 3 2 5 1...
5,480
Posted By wvdeijk
I'm on AIX, so don't have the xpg4/awk version...
I'm on AIX, so don't have the xpg4/awk version available. nawk seems to have the same 399 character limit.
Would it be possible to set up FIELDWIDTHS as an array? (in other words, set up the FWS...
5,480
Posted By wvdeijk
Finally managed to implement the setFieldsByWidth...
Finally managed to implement the setFieldsByWidth solution, and got it working once I realised that the function is an awk function, not a shell function (which would reside in my $FPATH):o. I do...
5,480
Posted By wvdeijk
Thanks. I do know all the field widths. I'll...
Thanks. I do know all the field widths. I'll try vgersh99's method and seee how it goes. Unfortunately, we don't have gawk installed, but that just means I'll have to create the function as well.
5,480
Posted By wvdeijk
Split long record into csv file
Hi

I receive a mainframe file which has very long records (1100 chars) with no field delimiters. I need to parse each record and output a comma delimited (csv) file. The record layout is fixed. ...
2,818
Posted By wvdeijk
Different record types/layouts in one file always...
Different record types/layouts in one file always causes more problems than it's worth. I think that your easiest solution would be to (1) modify your file1 so that all line contain all 4 fields -...
2,131
Posted By wvdeijk
It's not just cosmetic however. make treats each...
It's not just cosmetic however. make treats each command line as if it were executed in its own shell. Thus
cd output
rm *will not work in make as you would expect. But
cd output;rm *will work,...
3,390
Posted By wvdeijk
Why bother with an alias. ls -ld
Why bother with an alias.

ls -ld
25,459
Posted By wvdeijk
The END block is executed after all lines have...
The END block is executed after all lines have been read, so $NF is not available in the END block. Try this mod:

ls -lt | awk '{vw=$NF}END{print vw}'
21,963
Posted By wvdeijk
A possible way to do this is to write your own rm...
A possible way to do this is to write your own rm command which doesn't delete the files but instead moves it into a "recycle bin" directory. You could then periodically empty that directory by...
31,440
Posted By wvdeijk
gzip automatically stores the zipped file in...
gzip automatically stores the zipped file in XYZ.txt.gz, you do not need to do a redirect. What you are doing with the redirect is storing any gzip messages in XYZ.txt.gz, instead of the actual...
1,931
Posted By wvdeijk
We don't have sudo capabilities. What we are...
We don't have sudo capabilities. What we are told that we should do is send a request to our (external) unix management team to ask them to do the archive (and retrieval if we need something...
1,931
Posted By wvdeijk
how to identify files I cannot access
I want to use find (or something else) to give me a list of all files in a directory tree where the group access is not rwx or rw-. I'm trying to archive the whole directory tree, but it won't...
6,532
Posted By wvdeijk
I was afraid of that. Thanks, anyway.
I was afraid of that. Thanks, anyway.
6,532
Posted By wvdeijk
Using cut within makefile
Using the piece of code below within a makefile, I am getting nothing in variable YR. If I try the code at the command prompt it works fine. Please let me know what I'm doing wrong, or how I can...
2,391
Posted By wvdeijk
Type in ls ?? to list all files with 2...
Type in ls ?? to list all files with 2 character names. If this file is the only one, then you can mv ?? newfilename.
1,725
Posted By wvdeijk
fuser seems to tell me what processes are using...
fuser seems to tell me what processes are using the file. What the OP (and I) are interested in is knowing what files are linked to the file in question.
Forum: Open Source 06-21-2005
268,485
Posted By wvdeijk
Started with vi, but quickly migrated to emacs. ...
Started with vi, but quickly migrated to emacs. I just find it more powerful and easier to use, especially through an X window.
3,379
Posted By wvdeijk
Using expect here seems to be using a...
Using expect here seems to be using a sledgehammer to crack a nut. Why not simply use the unix file permissions. Get the owner of the script to add execute permissions for group or all on the...
9,824
Posted By wvdeijk
OK. Having it inside the loop threw me for a...
OK. Having it inside the loop threw me for a loop ;-) At first glance I thought it was just putting in 1 instance of the string at a time.

Thanks for the explanation.
9,824
Posted By wvdeijk
Don't you also need to append to the file (>>)...
Don't you also need to append to the file (>>) instead of just redirecting the yrs response. The way it is I don't think the file will ever grow. Or am I missing something?
30,460
Posted By wvdeijk
Where to set the LANG variable
When I login to my AIX server, the LANG variable is automatically being set to En_US. This is causing locale warning messages when I run emacs or perl. The reason seems to be that En_US is not a...
2,331
Posted By wvdeijk
Thank you.
Thank you.
2,331
Posted By wvdeijk
Help in simplifying a sed command
I need to do a substitution: CPF to ,C,P,F, CPM to ,C,P,M, SPF to ,S,P,F etc. I can do each of them with separate substitutions e.g. s/CPF/,C,P,F/ but I'd like to know if there is a...
Showing results 1 to 25 of 26

 

Featured Tech Videos

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