Showing results 1 to 25 of 150
Search took 0.02 seconds.
Search: Posts Made By: wbport
Forum: Shell Programming and Scripting 4 Days Ago
Replies: 9
Views: 432
Posted By wbport
Let's try this for a sed command file. You will...

Let's try this for a sed command file. You will need to specify -n before the name of your sed command file.
/-->/ { N
N
s/ *//
s/--//
s/>//
s/TP...
Forum: Shell Programming and Scripting 1 Week Ago
Replies: 9
Views: 432
Posted By wbport
It looks like sed could be useful here. This is...

It looks like sed could be useful here. This is how you could start your control file (file name after sed -f)./-->/ { N
N
....................
s/ */,/g
}From...
Forum: UNIX for Beginners Questions & Answers 1 Week Ago
Replies: 3
Views: 158
Posted By wbport
If it will be in a script perhaps datetime=`date...

If it will be in a script perhaps datetime=`date +%Y%m%d%H%M`
date >myFile.$datetime.csv
Forum: Shell Programming and Scripting 1 Week Ago
Replies: 6
Views: 341
Posted By wbport
PGN is Portable Game Notation is used to record...

PGN is Portable Game Notation is used to record chess games. Files are a-h from the queenside to kingside, ranks are 1-8 from White's side to Black's. Pieces are uppercase KQBNR in English and are...
Forum: Shell Programming and Scripting 1 Week Ago
Replies: 6
Views: 341
Posted By wbport
Do you have the option to output your PGN file...

Do you have the option to output your PGN file without computer annotation?
Forum: UNIX for Beginners Questions & Answers 2 Weeks Ago
Replies: 5
Views: 336
Posted By wbport
This script (we call ours lz) has an optional...

This script (we call ours lz) has an optional "-r" first parameter for descending sizes and/or the star name(s) you would put after an ls command.
rev=""
if [ $# -gt 0 ]
then
if [ $1 = '-r' ]...
Forum: Shell Programming and Scripting 2 Weeks Ago
Replies: 7
Views: 364
Posted By wbport
That didn't fly the first time but then I...

That didn't fly the first time but then I discovered a trailing space after all the valid six digit numbers, so adding a space before the $ fixed it.

I didn't realize a period didn't need to be...
Forum: Shell Programming and Scripting 2 Weeks Ago
Replies: 7
Views: 364
Posted By wbport
The "\" was to escape the decimal point so I...

The "\" was to escape the decimal point so I wanted six digits not followed by a decimal point. That got rid of my false positive using SCO Unix. Six digits with nothing else on the line was the...
Forum: Shell Programming and Scripting 2 Weeks Ago
Replies: 7
Views: 364
Posted By wbport
When business is done, the line starting with...

When business is done, the line starting with "Today" will be followed by a count and ten two-digit numbers (percents or dollar amounts)--my problem is when the count is zero and certain 0.00 are...
Forum: Shell Programming and Scripting 2 Weeks Ago
Replies: 7
Views: 364
Posted By wbport
File comparison problems

We are running parallel reports with Legacy vs a new system and want to compare certain lines with the diff or diff -b command. When a six digit number is read at the beginning of the line (no...
Forum: UNIX for Beginners Questions & Answers 3 Weeks Ago
Replies: 7
Views: 339
Posted By wbport
If the output file doesn't exist, you are good to...

If the output file doesn't exist, you are good to go. *
If the output is a directory, check it for the presence of your input file. *

* Possible extra check: do you have execute and write...
Forum: Shell Programming and Scripting 05-31-2018
Replies: 5
Views: 310
Posted By wbport
This should find anything starting with what you...

This should find anything starting with what you want, but finds everything, not just folders:
find / -name 'SUV28*' but you may have to pipe the output thru grep "^dr" to only get directories.

...
Forum: UNIX for Beginners Questions & Answers 05-15-2018
Replies: 4
Views: 245
Posted By wbport
Those log records are not created locally. If a...

Those log records are not created locally. If a procedure runs to completion, it over writes that record and the log files (actually one record each) should be sent to us. If the first record of a...
Forum: UNIX for Beginners Questions & Answers 05-15-2018
Replies: 4
Views: 245
Posted By wbport
When I ran "man sort" I saw the "-M" option but...

When I ran "man sort" I saw the "-M" option but didn't know how to implement it. Works like a charm:flatf 010156 flatf Thu May 10 22:47:48 CST 2017 flats finished
flatf 030118 flatf Thu Xxx 10...
Forum: UNIX for Beginners Questions & Answers 05-14-2018
Replies: 4
Views: 245
Posted By wbport
Sort in chronological order

I am trying to sort a log file in chronological order to identify which ones did not process and still have an old (probably yesterday's) date. This is a sample of the file:flatf 010140 flatf Thu...
Forum: Shell Programming and Scripting 04-27-2018
Replies: 4
Views: 313
Posted By wbport
Does sed 's/SK........//g' inputfile >outputfile...

Does sed 's/SK........//g' inputfile >outputfile work?
Forum: Shell Programming and Scripting 04-20-2018
Replies: 11
Views: 226
Posted By wbport
If you just want them listed together, the sort...

If you just want them listed together, the sort command would do that. if you only want "100.1.1.15". grep is something to try.

That's where I stop for now. You will learn it and retain it much...
Forum: Shell Programming and Scripting 04-19-2018
Replies: 3
Views: 188
Posted By wbport
Isn't that what the command dirname does? It...

Isn't that what the command dirname does? It only does one line at a time, though.

P.S. This is another way: sed 's/\/[^\/]*$//' The final operand (not shown) is the name of your input file.
Forum: Shell Programming and Scripting 04-19-2018
Replies: 2
Views: 160
Posted By wbport
One other option: sed -n "/...

One other option:
sed -n "/ [+-]*[0-9]*\.[0-9][0-9]* / p" hello.outIt writes nine lines given Durden's last example of hello.out.
Forum: UNIX for Beginners Questions & Answers 02-21-2018
Replies: 6
Views: 479
Posted By wbport
We call this script lz to sort by sizes.rev="" ...

We call this script lz to sort by sizes.rev=""
if [ $# -gt 0 ]
then
if [ $1 = '-r' ]
then
rev="r"
# echo $rev
shift
fi
fi
Forum: Shell Programming and Scripting 02-06-2018
Replies: 2
Views: 130
Posted By wbport
Thank you, that's some material I can learn from...

Thank you, that's some material I can learn from and build on.
Forum: Shell Programming and Scripting 02-05-2018
Replies: 2
Views: 130
Posted By wbport
Need to recalculate (subtract) before a reformat.

We are having to read a number of files from an outside source and have been given a layout that looks like this
LNPDTO 383 8 DATE Comment
LNACIN 391 14 S2 ...
Forum: UNIX for Beginners Questions & Answers 02-01-2018
Replies: 7
Views: 824
Posted By wbport
True. EBCDIC or ASCII only describe the hex code...

True. EBCDIC or ASCII only describe the hex code used to represent a character, like the letter B is x'42' (ASCII) or x'c2' (EBCDIC). It wouldn't apply to packed decimal, binary, or floating point....
Forum: UNIX for Beginners Questions & Answers 01-31-2018
Replies: 7
Views: 824
Posted By wbport
Packed decimal has little to do with EBCDIC or...

Packed decimal has little to do with EBCDIC or ASCII. Each byte contains two decimal digits except the last byte may contain a sign like x'C' for positive, x'D' for negative, and x'F' for unsigned....
Forum: UNIX for Beginners Questions & Answers 01-31-2018
Replies: 7
Views: 824
Posted By wbport
It would help to know the source of this data--is...

It would help to know the source of this data--is it mostly letters and numbers or are there a lot of special characters. If you have very few characters (like Greek letters, graphics, or math...
Showing results 1 to 25 of 150

 


All times are GMT -4. The time now is 07:50 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?