Txt

Byte sized tech know-how.

  • Home
  • About

Tag Archives: text

25 May

Iterate a Text File in Bash

This is how you iterate thru a text file outputting a line at a time in Bash shell scripting.


IFS='\n'; for i in(cat FILE.TXT); do echo "$i"; done
admin Posted in Code, Command Line, Linux for, iterate, line, text 3 Comments
11 Aug

Send One Line From a Text File as as SMS Every 10 Mins

This command will send a line from a given text file one every 10 mins as an SMS to a given number.


i=1; while [ 1 ]; do sms INSERT_PHONE_NUMBER "(cat "/home/binnyva/sms.txt"|head -ni|tail -n1)"; sleep 10m; i=(expri + 1); done

Script calls the command ‘sms’ – you can define that command however you want. In my case, its a variation of this script.

admin Posted in Command Line, Linux command, file, Linux, sms, text 2 Comments
11 Aug

Send Text Once Every 15 Mins

Command to send a text to any phone once every 15 mins.


while [ 1 ]; do sms NUMBER_GOES_HERE "$(date '+%I:%M %p') Hey Anju. Still awake?"; sleep 15m; done

Script calls the command ‘sms’ – you can define that command however you want. In my case, its a variation of this script.

admin Posted in Command Line, Linux command, Linux, sleep, sms, text, while Leave a comment
06 Jul

Install Package List

Install a list of packages from a text file.


cat packages.txt | xargs apt-get install
admin Posted in Command Line, Linux command, file, install, Linux, list, package, text Leave a comment
25 Jun

Replacing in Found Files

Replace one string by another in all file found by find.


find . -name *whatyouwant* -exec perl -pi.bak -e 's/TEXT_TO_REPLACE/TEXT_TO_REPLACE_IT_WITH/g' {} \;
admin Posted in Command Line, Linux, Perl command, find, Linux, Perl, replace, string, text Leave a comment
11 Jan

Spell Check a Text File using Aspell

You can use Aspell to spell check of a text document using this command. It must be executed in a termial – as it has an console interface.


aspell check test.txt

Original Article

admin Posted in Command Line, Linux aspell, check, command, Linux, spell, spelling, text 1 Comment
23 Oct

Optimized Grep Searching

Grep that searches recursively, ignores binary files, and doesn’t look inside Subversion hidden folders.


grep -Ir --exclude="*\.svn*" "pattern" *
admin Posted in Command Line, Linux command, exclude, find, grep, Linux, pattern, search, text Leave a comment
01 Sep

Delete all \n chars in a file…

Delete all \n chars in a file…


tr -d "\n" 
admin Posted in Command Line, Linux command, delete, line, Linux, new, newline, slashn, text, tr Leave a comment
21 Jun

Text type convert

Convert a text file format from MSDOS to UNIX


dos2unix input_file output_file
admin Posted in Uncategorized command, dos, dos2unix, eol, line, Linux, text, unix Leave a comment
02 Jun

Get the Plain Text Version of a Web Page

This command fetches a web page, converts it to text and shows it.


lynx -dump http://www.example.com/
admin Posted in Command Line, HTML, Linux command, dump, fetch, HTML, Linux, lynx, page, text, web Leave a comment

Post navigation

← Older posts

Categories

  • Code
  • Command Line
  • Configuration
  • CSS
  • HTML
  • internet
  • JavaScript
  • Linux
  • Mobile
  • Perl
  • PHP
  • Python
  • Ruby
  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Fruitful theme by fruitfulcode Powered by: WordPress
↑