Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Strip out number from wc output? Post 302910359 by neutronscott on Wednesday 23rd of July 2014 09:43:07 PM
Old 07-23-2014
so the output seems to be of only 1 wc command? $() will only strip the last \n. it sounds like a \r but wc shouldn't output that. is this Windows or Cygwin?

if you do
Code:
echo "$(wc -l file) $(wc -l file)" | cat -e

do you get
Code:
0 file^M0 file$

if so try replacing wc with a function that'll strip that
Code:
wc() { command wc "$@" | sed 's/\r//'; }

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to Strip lines off Streamed EDI Output

Attached is a streamed EDI ANSI X12 output where the segment terminator/delimiter is a tilde ~ character. Is it possible to do the following pseudo-code in a unix script (using either sed, awk and/or grep)? Open file StreamedOutput.txt Search for ISA and delete the data up to the tilde ~ char... (7 Replies)
Discussion started by: sapedi
7 Replies

2. Shell Programming and Scripting

KSH Output/Strip portion of file in HP-UX

I have a file, we'll call it file.txt. It has thousands of lines of all kinds of output at any given time (ie. foo bar foo bar) I need to copy out just a portion of the file from Point-A to Point-B. I'd like to save off just that portion to a file called test123xyz.txt. How do I do that? ... (7 Replies)
Discussion started by: austin881
7 Replies

3. Shell Programming and Scripting

find with given number and express output

file A eebbbeeeeee file B 4 Question is by file B and look into file A output is b awk -v v1=4 file B or something else (2 Replies)
Discussion started by: cdfd123
2 Replies

4. Shell Programming and Scripting

Extract particular number from the command output

Hi Folks, I want to use particular number as a variable output..Please find the below for scenario... Example 1:- Below output i want to use secondary group 9003 as a variable output $ id -a |awk -NF '{print $3}' groups=99(local),9003(testadmin) Else I want to use 2006 as a... (8 Replies)
Discussion started by: susindram
8 Replies

5. Shell Programming and Scripting

awk number output

Hi, I have a problem when doing calculations in awk. I want to add up a few numbers and output the result. testfile: 48844322.87 7500.00 10577415.87 3601951.41 586877.64 1947813.89 $ awk '{x=x+$1};END{print x}' testfile 6.55659e+07The problem is the number format. It should show... (3 Replies)
Discussion started by: Subbeh
3 Replies

6. Shell Programming and Scripting

Getting awk Output as number instead of String

Hi All, I have a file a.txt, content as mentioned below: 22454750 This data in this control file and I have a variable called vCount which contains a number. I need to extract the 22454750 from the above file and compare with the variable vCount. If match fine or else exit. ... (5 Replies)
Discussion started by: Arun Mishra
5 Replies

7. UNIX for Dummies Questions & Answers

The number of links, output of ls

hi: i am trying to understand the concept of the output of ls command, specifically "number of links" for a directory and got utterly confused: 1) when i made first directory in my home directory: dave@host:~:$ mkdir dir_l1 from the perspective of home directory, the link number for... (2 Replies)
Discussion started by: ipfreak
2 Replies

8. Shell Programming and Scripting

awk to output lines less than number

I am trying to output all lines in a file where $7 is less than 30. The below code does create a result file, but with all lines in the original file. The original file is tab deliminated is that the problem? Thank you :). awk 'BEGIN{FS=OFS=","} $7 < 30 {print}' file.txt > result.txt... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. UNIX for Beginners Questions & Answers

How to output non-number lines with grep?

I want to check my data quality. I want to output the lines with non-number. I used the grep command: grep '' myfile.csv Since my file is csv file, I don't want to output the lines with comma. And I also don't want to output "." or space. But I still get the lines like the following:... (8 Replies)
Discussion started by: twotwo
8 Replies
TIFFReadRawStrip(3T)													      TIFFReadRawStrip(3T)

NAME
TIFFReadRawStrip - return the undecoded contents of a strip of data from an open TIFF file SYNOPSIS
#include <tiffio.h> tsize_t TIFFReadRawStrip(TIFF* tif, tstrip_t strip, tdata_t buf, tsize_t size) DESCRIPTION
Read the contents of the specified strip into the (user supplied) data buffer. Note that the value of strip is a ``raw strip number.'' That is, the caller must take into account whether or not the data is organized in separate planes (PlanarConfiguration=2). To read a full strip of data the data buffer should typically be at least as large as the number returned by TIFFStripSize. RETURN VALUES
The actual number of bytes of data that were placed in buf is returned; TIFFReadEncodedStrip returns -1 if an error was encountered. DIAGNOSTICS
All error messages are directed to the TIFFError(3T) routine. SEE ALSO
libtiff(3T), TIFFOpen(3T), TIFFReadEncodedStrip(3T), TIFFReadScanline(3T), TIFFStripSize(3T) October 15, 1995 TIFFReadRawStrip(3T)
All times are GMT -4. The time now is 04:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy