01-06-2010
Allister,
Thanks for your assistance. I just found out/remember that some might variate in the line location of the monitor. Some will be line 2 and other might be line 3 or 4. So with the getline that will only return the ones with it on line two. So I am gonna try and find a way using awk for this.
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
All,
I have a requirement where I will need to split a line into multiple lines.
Ex:
Input:
2ABCDEFGH2POIYUY2ASDGGF2QWERTY
Output:
2ABCDEFGH
2POIYUY
2ASDGGF
2QWERTY
The data is of no fixed lenght. Only the lines have to start with 2.
How can this be done. (5 Replies)
Discussion started by: kingofprussia
5 Replies
2. Shell Programming and Scripting
I have a file with a set of insert statements some of which have a single column value that crosses multiple lines causing the statement to fail in sql*plue. Can someone help me with a sed script to replace the new lines with chr(10)?
here is an example:
insert into mytable(id, field1, field2)... (3 Replies)
Discussion started by: jjordan
3 Replies
3. Shell Programming and Scripting
Hi guys, looking for a bit of advise, and as I am a complete novice, please excuse the daft questions!!
I have a list of events and of which entry looks like this;
#
# Event 1
# NAME = Event 1
#
12345 : 123 : 1 : 1 : L,1,N : 1,0 : Event
#
# Event 2
# NAME = Event 2
#
12346... (8 Replies)
Discussion started by: JayC89
8 Replies
4. Shell Programming and Scripting
echo "please enter ur choice..
1. Make a file.
2. Display contents
3. Copy the file
4. Rename the file
5. Delete the file
6. Exit"
read choice
case $choice in
1 ) echo enter the file name
read fname
if
then
echo... (2 Replies)
Discussion started by: gotam
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I'm trying to get lines from a file using identifiers in the first two columns. I have used:
cat MasterFile.txt | grep -f Pattern.txt
and the lines I want display on screen. If I try to put them in a file the file is created but stays empty:
cat MasterFile.txt | grep -f Pattern.txt... (14 Replies)
Discussion started by: FGPonce
14 Replies
6. Shell Programming and Scripting
Hi All,
I am stuck in one step..
I have one file named file.txt having content:
And SGMT.perd_id = (SELECT cal.fiscal_perd_id FROM $ODS_TARGT.TIM_DT_CAL_D CAL
FROM $ODS_TARGT.GL_COA_SEGMNT_XREF_A SGMT
SGMT.COA_XREF_TYP_IDN In (SEL COA_XREF_TYP_IDN From... (4 Replies)
Discussion started by: Shilpi Gupta
4 Replies
7. Shell Programming and Scripting
Hi Everyone,
Im currently using the below code to pull data from a large CSV file and put it into smaller files with just the data associated with the number that I "grep".
grep 'M053' test.csv > test053.csv
Is there a way that I can use grep to run through my file like the example below... (6 Replies)
Discussion started by: TheStruggle
6 Replies
8. Shell Programming and Scripting
Hi, if i have data like below:
Control|AC-00011-CN-2475208 AC-00011-CN-2475211 AC-00007-CN-2475238 AC-00007-CN-2475241
Im getting output in required format as below
Control|AC-00011-CN-2475208
Control|AC-00011-CN-2475211
Control|AC-00007-CN-2475238
Control|AC-00007-CN-2475241
using
awk... (9 Replies)
Discussion started by: JSKOBS
9 Replies
9. UNIX for Beginners Questions & Answers
I use this to get 8 random letters:
cat /dev/urandom | tr -dc 'A-Z' | fold -w 8 | head -n 1
Result is,
WLGFJFZY
What I'm trying to do is get 10 lines of random letters, separated by a line and each block having ascending numbers
i.e;
00
IWMTDFIM
01
KZZZCHPQ
02
YBTGFHGT
03 (4 Replies)
Discussion started by: jenny-mac
4 Replies
LEARN ABOUT CENTOS
getdelim
GETLINE(3) Linux Programmer's Manual GETLINE(3)
NAME
getline, getdelim - delimited string input
SYNOPSIS
#include <stdio.h>
ssize_t getline(char **lineptr, size_t *n, FILE *stream);
ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
getline(), getdelim():
Since glibc 2.10:
_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700
Before glibc 2.10:
_GNU_SOURCE
DESCRIPTION
getline() reads an entire line from stream, storing the address of the buffer containing the text into *lineptr. The buffer is null-termi-
nated and includes the newline character, if one was found.
If *lineptr is NULL, then getline() will allocate a buffer for storing the line, which should be freed by the user program. (In this case,
the value in *n is ignored.)
Alternatively, before calling getline(), *lineptr can contain a pointer to a malloc(3)-allocated buffer *n bytes in size. If the buffer is
not large enough to hold the line, getline() resizes it with realloc(3), updating *lineptr and *n as necessary.
In either case, on a successful call, *lineptr and *n will be updated to reflect the buffer address and allocated size respectively.
getdelim() works like getline(), except that a line delimiter other than newline can be specified as the delimiter argument. As with get-
line(), a delimiter character is not added if one was not present in the input before end of file was reached.
RETURN VALUE
On success, getline() and getdelim() return the number of characters read, including the delimiter character, but not including the termi-
nating null byte ('