Sponsored Content
Top Forums Shell Programming and Scripting Count characters in a csv file and add an word. Post 302721479 by RudiC on Thursday 25th of October 2012 12:40:46 PM
Old 10-25-2012
Code:
awk  'BEGIN{OFS=FS="\",\""} NR>1 {if (length($3) < 30) sub("\"", " "$2" is great\"", $3)}1' file
"category","title","post" 
"Z","Zoo","test 54325 test 45363mc. Zoo is great"
"Z","Zen","rs2w3rsj 2d342dg 2d3s4f23 d23423s23h 2s34s2423g ds232d34 2342."
"Z","Zet","test4444 dd. Zet is great"

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Word Count without any characters but the Output String

Hi all, I am logging any access to a server, and i wanted to write a script which tells me how much entries there are. The Problem is that "wc -l log" outputs the correct number of lines but with the name of the file attached. is there any nice possibility to solve this that i ONLY... (3 Replies)
Discussion started by: JP_II
3 Replies

2. Shell Programming and Scripting

How to find a count of a word within a file

Hello, I'm looking for a wait to count the number of occurrences of a certain string of characters within a file. The file that I trying to parce has segments within the file that have a header and footer to each segment and I'm trying to do a count of the header string and compare it to a count... (9 Replies)
Discussion started by: bd_joy
9 Replies

3. Shell Programming and Scripting

Record count of a csv file

Hello Gurus, We have a requirement to count the valid number of records in a comma delimited file with double quotes. The catch here is..few records have a new line carriage within the double quotes,,say for ex:we have a file called accounts the record count is 4827..but the actual valid count... (5 Replies)
Discussion started by: ajaykk
5 Replies

4. Shell Programming and Scripting

how to count characters by line of file ?

Hello, Member or professional need help how to count characters by line of file Example of the file is here cdr20080817164322811681txt cdr20080817164322811txt cdr20080817164322811683txt cdr20080817164322811684txt I want to count the characters by line of file . The output that I... (4 Replies)
Discussion started by: ooilinlove
4 Replies

5. Shell Programming and Scripting

how to count a word in a file

dear all, i have a requirement to count the errors and display from a file. eg. file1.txt sjdgfjdgfgd ora-0001 sdjgfydh sdukgh7 23 sjdgfjdgfgd ora-0002 sdjgfydhsf34 ew 34v sjdgfjdgfgd ora-0008 sdjgfydh asdf asdfas sjdgfjdgfgd ora-0001 sdjgfydhjkbs ui873 sjdgfjdgfgd ora-0004 sdjgfydh... (9 Replies)
Discussion started by: unx100
9 Replies

6. UNIX for Dummies Questions & Answers

find a word in a file, plus the next 6 characters?

I plan to use sed in a script to replace a string. My problem is the last 6 characters of the word to be replaced can be different each time, plus it's not always in the same spot on the line so I can't use cut or nawk to get the field. So I am looking for a way to find a certain word in a file,... (6 Replies)
Discussion started by: mikayla73
6 Replies

7. Shell Programming and Scripting

Find word in file then get following characters

Hello, I have several xml files from which I want to find and return a particular string I want to locate the InId="00000008". Now that is inlcuded within a tag and ofcourse the number is different every time this is what I came up with given that after greping the line that contains the... (6 Replies)
Discussion started by: TasosARISFC
6 Replies

8. Shell Programming and Scripting

How to append word count at end of file?

Hi guys, I have to append the word count of a file at the end of the file name like this - > "filename_2345" where 2345 is the word count of "filename". How do i achieve this using one command ? I am not allowed to store the word count in a variable and then concatenate. Request your... (1 Reply)
Discussion started by: peter2312
1 Replies

9. UNIX for Beginners Questions & Answers

UNIX script to check word count of each word in file

I am trying to figure out to find word count of each word from my file sample file hi how are you hi are you ok sample out put hi 1 how 1 are 1 you 1 hi 1 are 1 you 1 ok 1 wc -l filename is not helping , i think we will have to split the lines and count and then print and also... (4 Replies)
Discussion started by: mirwasim
4 Replies

10. Shell Programming and Scripting

Row Count in .csv file

Hi, I have to find the count of rows starting with "E," in given a.csv file . Sample Data File. E,2333AED,A,MC3,25,31-MAY-18 E,2333AED,A,MC3,25,31-MAY-18 CYMC3 25AED 0000 E,2333CZK,A,MC3,25,31-MAY-18 CYMC3 25CZK 0000 E,2333EUR,A,MC3,25,31-MAY-18... (3 Replies)
Discussion started by: Prabhakar Y
3 Replies
CURSES_BORDER(3)					   BSD Library Functions Manual 					  CURSES_BORDER(3)

NAME
curses_border, border, box, wborder -- curses border drawing routines LIBRARY
Curses Library (libcurses, -lcurses) SYNOPSIS
#include <curses.h> int border(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br); int box(WINDOW *win, chtype vertical, chtype horizontal); int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br); DESCRIPTION
These functions draw borders around stdscr or around the specified window. The border() function draws a border around stdscr using the characters given as arguments to the function. The ls, rs, ts and bs are the characters used to draw the left, right, top and bottom sides, respectively. The tl, tr, bl and br are the characters used to draw the top- left, top-right, bottom-left and bottom-right corners, respectively. If any of the characters have a text portion that is 0 then a default alternate character set character is used for that character. Note that even though the text portion of the argument is 0, the argument can still be used to specify the attributes for that portion of the border. The following table shows the default characters for each argument: ls ACS_VLINE rs ACS_VLINE ts ACS_HLINE bs ACS_HLINE tl ACS_ULCORNER tr ACS_URCORNER bl ACS_LLCORNER br ACS_LRCORNER wborder() is the same as border() excepting that the border is drawn around the specified window. The box() command draws a box around the window given in win using the vertical character for the vertical lines and the horizontal character for the horizontal lines. The corner characters of this box will be the defaults as described for border() above. Passing characters with text portion that is 0 to box() will result in the same defaults as those for border() as described above. RETURN VALUES
Functions returning pointers will return NULL if an error is detected. The functions that return an int will return one of the following values: OK The function completed successfully. ERR An error occurred in the function. SEE ALSO
curses_attributes(3), curses_line(3) STANDARDS
The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification. HISTORY
The Curses package appeared in 4.0BSD. BSD
August 12, 2002 BSD
All times are GMT -4. The time now is 12:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy