Saturday, 29 November 2008

7: \n and \t

Here are two codes that you will use all the time:

\t means tab
\n means new line

Textpad is at its best when using tab seperated values (TSV), which is exactly what we find in excel spreadsheets. Below, you'll see data represented in a spreadsheet...

 

...and in textpad...



...and, finally, here is the first line of data as a 'find' line in textpad:

david nicholls\ttheunderstudy\tHodder & Stoughton\t1\n

So, wherever there is a tab, we represent it as \t

(Strictly speaking, there is enough detail here that the \n is uneccesary - it's just there to demonstrate. Another more accurate way to represent this is to use at the end of the line - it means 'end of the line'. More on this later.)


No comments: