Sponsored Content
Full Discussion: Incomplete last line
Top Forums Shell Programming and Scripting Incomplete last line Post 302468463 by smee on Tuesday 2nd of November 2010 08:24:00 PM
Old 11-02-2010
Java Incomplete last line

I need help with appending the last line to the file only if the last line is incomplete.

I tried awk 1 filename > new_filename but it appends to every file and I only want to append to the file if the last line is incomplete
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

append newline to files with incomplete last line

Hi all, Is there any way I can check a file for the linefeed character at the end of the file, and append one only if it is missing (ie. Incomplete last line)? Need to do this because I need to write a script to process files FTP-ed over from various machines, which may or may not be... (1 Reply)
Discussion started by: ziyi
1 Replies

2. Shell Programming and Scripting

Join of files is incomplete?!

Hi folks, I am using the join command to join two files on a common field as follows: File1.txt Adsorption|H01.181.529.047 Adult|M01.060.116 Children|M01.055 File2.txt 5|Adsorption|C0001674 7|Adult|C000001 6|Children|C00002 join -i -t "|" -a 2 -1 1 -2 2 File1.txt File2.txt This... (7 Replies)
Discussion started by: s0460205
7 Replies

3. IP Networking

Incomplete three way handshake

I've got a strange problem with a single mail sender (it is one of those large free mail providers). My mail server works well with thousands of senders but not this one, so we have made a connection dump and it seems that the three way handshake is not completed 15:55:59.177431 IP... (0 Replies)
Discussion started by: 3wayTrouble
0 Replies

4. Shell Programming and Scripting

How to ignore incomplete files

On Solaris & AIX, suppose there is a directory 'dir'. Log files of size approx 1MB are continuously being deposited here by scp command. I have a script that scans this dir every 5 mins and moves away the log files that have been deposited so far. How do I design my script so that I pick up... (6 Replies)
Discussion started by: sentak
6 Replies

5. Solaris

How to ignore incomplete files

On Solaris, suppose there is a directory 'dir'. Log files of size approx 1MB are continuously being deposited here by scp command. I have a script that scans this dir every 5 mins and moves away the log files that have been deposited so far. How do I design my script so that I pick up *only*... (6 Replies)
Discussion started by: sentak
6 Replies

6. Shell Programming and Scripting

incomplete last line

How do I find through script if a contains "incomplete last line". If it does then only insert a new line character as:: echo "" >> filename.txt (4 Replies)
Discussion started by: PRKS
4 Replies

7. Shell Programming and Scripting

script incomplete

#!/bin/bash DIR=/dir/$(date +%y%m) || mkdir "$DIR" for D in $@ # obtem os argumentos do cp /usr/home/backup if backup=null then mkdir backup done How can I complete that script, that's not value, can someone help me complete this... The point of the program is: - If the... (1 Reply)
Discussion started by: strshel
1 Replies

8. UNIX for Dummies Questions & Answers

Help with incomplete Code

Hello, Since i am new in shell scripting, i need some help from you guys. :rolleyes: I am trying to implement an automata that reflects the attached photo.. The main idea behind is to take an array of (0 & 1)s from the user and terminate it by "end". Then, the string is send to the function... (1 Reply)
Discussion started by: Geekie
1 Replies

9. UNIX for Dummies Questions & Answers

Delete incomplete data

Hi all, Please help with the following example. I want to keep all people in the data, who at least have Firstname or Lastname or both and at least 1 row of Details. So, Person4 lacking both Firstname and Lastname will be deleted, Person5 with no Details will be deleted. Firstname,Lastname... (3 Replies)
Discussion started by: ritakadm
3 Replies
JOIN(1) 						      General Commands Manual							   JOIN(1)

NAME
join - relational database operator SYNOPSIS
join [-an] [-e s] [-o list] [-tc] file1 file2 DESCRIPTION
Join forms, on the standard output, a join of the two relations specified by the lines of file1 and file2. If file1 is `-', the standard input is used. File1 and file2 must be sorted in increasing ASCII collating sequence on the fields on which they are to be joined, normally the first in each line. There is one line in the output for each pair of lines in file1 and file2 that have identical join fields. The output line normally con- sists of the common field, then the rest of the line from file1, then the rest of the line from file2. Fields are normally separated by blank, tab or newline. In this case, multiple separators count as one, and leading separators are dis- carded. These options are recognized: -an In addition to the normal output, produce a line for each unpairable line in file n, where n is 1 or 2. -e s Replace empty output fields by string s. -o list Each output line comprises the fields specified in list, each element of which has the form n.m, where n is a file number and m is a field number. -tc Use character c as a separator (tab character). Every appearance of c in a line is significant. SEE ALSO
sort(1), comm(1), awk(1). BUGS
With default field separation, the collating sequence is that of sort -b; with -t, the sequence is that of a plain sort. The conventions of join, sort, comm, uniq, look and awk(1) are wildly incongruous. 7th Edition April 29, 1985 JOIN(1)
All times are GMT -4. The time now is 02:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy