A string is a sequence of zero or more characters. It is commonly used to represent text or a sequence of bytes. Use this tag along with the appropriate programming language being used.

learn more… | top users | synonyms

13
votes
8answers
1k views

Bash Script to repeat every word in a line?

I have a string like: dog cat bird whale And I want to get dog dog cat cat bird bird whale whale All the words are in the same line. Any idea?
13
votes
5answers
26k views

Formatting a comma-delimited CSV to force Excel to interpret value as a string

Searching around for a while trying to figure out how to format a CSV file in such a way to force Excel to interpret the values as a string and not try and convert them to numbers or dates. e.g... ...
13
votes
3answers
70k views

Excel: Replace occurences of one character with another in a String?

I want an excel formula that will change Haverford, PA to haverford,+pa. (Text is to lowercase, and spaces are replaced with plus characters.) The following will get the first space, but not all of ...
13
votes
3answers
6k views

Escaping apostrophe in single quotes string in bash

I don't understand how Bash evaluates escaping of apostrophe characters in single quoted strings. $ echo ''\''Hello World'\''' 'Hello World' #works $ echo '\'Hello World\'' > # expects you to ...
5
votes
5answers
13k views

Excel Cell Length Limit

Excel is refusing to open some of the files I programmaticaly create. I think what is happening is that it pukes because a particular column has very long strings (up to 1850 chars), but for the ...
4
votes
3answers
26k views

Any Excel function that will reverse a string?

Are there any built-in Excel functions that will reverse a string?
4
votes
4answers
4k views

What is a Linux command to find files containing some strings but not another?

I'm trying to search a lot of XML files for certain strings but not other strings, and I'm having trouble putting a command together to do it. I only want it to list the file names that match the ...
4
votes
2answers
709 views

concatenate cmd line starting from some parameter

If I get a cmd line like: myscript param1 param2 param3 param4 param5 param6 ... (so on) How can I save a string consisting of parameters starting from some specific one? The $@ gives me the whole ...
4
votes
3answers
3k views

How to use grep to match domain names?

I have a list of urls like: hxxp://url.com/subpage.html hxxp://www.url2.com/index.php hxxp://subdomain.url3.com/somepage.php ... How can I use grep to match the domain names only? All the urls ...
3
votes
4answers
2k views

How to get the shortest string in a text file with shell

Assume I have a text file as below abcd aaaaaaa gfgk hahahahahahhahh gf Then gf would be returned.Any good ideas?
3
votes
3answers
544 views

Using vim to delete all lines except those that match an arbitrary set of strings

I use vim to remove all lines except those that match a particular string, e.g. :g!/[string that I want to remain in the editor]/d Works great. But what I really want, and haven't found anywhere, ...
3
votes
6answers
1k views

Single line diff

Is there a diff tool I can run from the command line or maybe just an online webpage that will compare single lines? GitHub diffs do this but I'm don't want to publish things to GitHub just to read ...
3
votes
5answers
752 views

Convert string “1-5” into array of numbers in bash

What is the best approach to convert the string containing the range of numbers into numbers itself? This format is used for example in defining the range of pages to print. I define, I want to print ...
2
votes
4answers
38k views

Excel extract substring from string

I am looking for a way to extract a variable length substring from a string. My cells will look something like: ABC - DEF ABCDE - DEF ABCD - ABC I want to split the string at the - character, so ...
2
votes
2answers
285 views

sed in bash not working

I am trying to use the stream editor sed in bash to replace a string in a file to a new string that I entered, I have this thus far: echo "name to change" read updatenaamold echo "enter new name:" ...
2
votes
3answers
5k views

Excel CSV import treating quoted strings of numbers as numeric values, not strings

I've got a web application that is exporting its data to a CSV file. Here's one example row of the CSV file in question: 28,"65154",02/21/2013 00:00,"false","0316295","8316012,8315844","MALE" ...
2
votes
3answers
1k views

Get LVM size using AWK?

I'm in need to find out the LVM size of image vm001. Let's say I have a LVM volume called /dev/VGgroup/vm001. Now using lvdisplay I can find out the size: --- Logical volume --- LV Name ...
2
votes
2answers
807 views

Find more than one string with Excel?

How to Find more than one string with Microsoft Office Excel? For example, I am looking for the cells which is contained both strings Paul and John? How to avoid to perform several finds by ...
2
votes
1answer
6k views

function keys for paste specific text

I want to assign some text to F keys on Windows 7. For example, I want to press F5 to paste "000", or press F6 to paste ".00 US Dollars". It would be appreciated if anyone can help me (a piece of ...
2
votes
1answer
655 views

Formatting a tab-delimited CSV/TSV to force Excel to interpret value as a string

I had a followup question to this related post - Formatting a CSV to force Excel to interpret value as a string (not date or number) I was wondering how does one escape text starting with " using ...
2
votes
1answer
115 views

Excel VBA - User Defined Function to turn string into formula

I'm looking for something similar to the solution posted here: Excel function that evaluates a string as if it were a formula? Problem is this does not seem to work with a function in there. This ...
2
votes
1answer
10k views

Can I force an Excel 2010 Pivot-Table to display text strings from my raw data?

Here is my use-case. As a training specialist I want to look at a single tab in Excel and see student feedback at a glance. I want to see pie-charts showing who said "Yes" this course was a good use ...
2
votes
2answers
420 views

how to make '' AND “” syntax highlight strings for python in notepad++?

Currently I have only "doubleQuotes" highlighted but the 'single ones' stay normal. Can someone confirm? Or have a solution how to fix that? In the stylers.xml there is WordsStyle named STRING which ...
1
vote
2answers
107 views

A method to find two strings within distance

I have a large text file collection. I'm looking for a way to find two strings that are on the same line (in the same file) in the collection where the distance in characters between those two ...
1
vote
1answer
41 views

How To Search for multiple multi-word strings in vim?

For example I'm trying to search for the occurence of both hello world and goodbye world in the same line. I've tried a bunch of difference iterations. For example, if you want to find one multi-word ...
1
vote
1answer
999 views

how to search for a specific string in the body of lotus notes email

There are previous questions similar to this have been asked but never answered explicitly. Simply saving use search all documents with an indexed database is not a complete answer. How do you ...
1
vote
1answer
46 views

Converting strings in input file

I have a text file file1.txt on Unix. I'd like to produce another file file2.txt, in which I change all groups of lines that has this format (taken from a multiple-choice exam) a. [first choice] b. ...
1
vote
2answers
273 views

How to search for any files that do not contain a proper XML root element?

I need to be able to search several thousand XHTML and XML files and see a list of files that do not contain the following string on the first line: <?xml version="1.0" encoding="utf-8"?> How ...
1
vote
3answers
4k views

How can I extract sub-strings using windows command-line?

For example say I have a file called testfile.txt that contains a list of file names of the following format: A svn\New Text Document.txt M svn\Table_tblVersion.xml Is there a command ...
1
vote
3answers
100 views

How can SHA512 make a long string into a short string

I´m wondering how this random and very long string €£$€@]}$€{[$£}]£[€€£$€@]}$€{[$£}]£[€]}€486745896€$@fdhhsgpbkjhYUVYUDTYhµµµ½789ty45thhrhYUFVYU7645646f8cgI JKHVruxty dw78fg f 9w64f ...
1
vote
1answer
91 views

String variability generator: Forgotten password

There's a website that I changed my password on about 2 years ago, then quit. I know about 10 possibilities of what the password could be, and what I usually do is exchange a letter with a symbol, but ...
1
vote
1answer
465 views

Scrape a site with curl/wget appending a parameter to each site

I need to scrape a website for all sites and append an Paramater, e.g. www.theSite.com/allpages?myPara=us Now what I got is wget --recursive to get all sites, but that doesn't append the parameter ...
1
vote
1answer
378 views

Symbol which looks like . (dot) but is classified as letter in unicode

Iam writing my bachelor thesis at the moment. The problem for me is now the spellchecker (I use Open Office but this is a general problem) won't recognize .NET as a valid word. A also cannot add it to ...
1
vote
1answer
13 views

Iptables: Filtering string encrypted by ssl

I need to filter (send to BANRULES set) incoming http/https packets with a certain string (matchword). I do it easy when ssl is not in use (port 80): iptables -A INPUT -p tcp -m tcp --dport 80 -m ...
1
vote
0answers
16 views

calc: Extract string from range of cells

I´m trying to figure out a easy to understand way to extract a string (that is in a range of cells) from a range of cells... That is the range of cells I have to look for a specific string (in a ...
1
vote
2answers
79 views

Is it possible to see if two cells contain similar text in Excel? [duplicate]

I've got two columns populated with names, and I want to see if the names in each row are similar (not the exact same, just similar) to each other. Is there any way to do this on Excel?
1
vote
1answer
258 views

Search, copy, paste, edit string in hex?

I'm using Windows 7 64-bit. I've got around 10,000 or so files that I want to edit. The trouble is that's just far too much to do by hand. I'll explain what I need to do below. In these files, there ...
1
vote
0answers
91 views

GPU used for String operations ?

Am working a bit on CUDA, most of the examples and tutorials i see deal with implementing mathematical functions on the GPU ( Like some vector / matrix calculations). I was wondering if we can ...
1
vote
1answer
183 views

Batch : extract some characters of a string

How can I extract alphanumeric characters only from a string? Example : b:lbalbqsd1287/;:!, gives blbalbqsd1287 Is it possible with findstr?
1
vote
1answer
370 views

Protocol URL in Firefox doesn't work if it contains “%2F”

If I write something like the following into the navigation bar of Mozilla Firefox, nothing happens: ...
1
vote
1answer
329 views

notepad++ to search a line for varied strings. advanced commands

here it is ab12@zmial.com, Charles Dawson cd21@zmial.com, ef23@zmial.com, gh32@zmial.com, ij34@zmial.com, mn45@zmial.com, op54@zmial.com, Queen Roffman qr56@zmial.com, kl43@zmial.com, ...
1
vote
3answers
58 views

Microsoft SQL. SELECT FROM WHERE query with varchar type column

Inside the SQL Server Management Studio I am trying a query like this: In human words: Give me all rows from the table where the string in the column "name" is "alice". My not working attempt on ...
0
votes
2answers
390 views

Search recursively for a string containing whitespaces

I want to search for "this table..." string under /home/myuser directory recursively, ie in all files under /home/myuser and in all directories and sub-directories under /home/myuser. /home/myuser ...
0
votes
2answers
688 views

What the best program for string manipulation [closed]

I would like to know the best program (Surely a text editor) to make string manipulation like string substituion. By the way, I would like to do the next: String manipulation of type String ...
0
votes
2answers
55 views

How do different operators deal with a given string

I want to read two strings as parameters to bash script, these strings are meant to be extensions, then I want to replace the extension of files with the first extension to the second extension. The ...
0
votes
2answers
1k views

How to concat String, File Contents, and String in bash script?

I have a file which contains only one line $> cat file.txt apple,orange,cat,dog I need to append two String to it and assign it to a variable, one in front and another in the end, so that it ...
0
votes
1answer
694 views

how to replace unknown substring of line with sed

I want to replace a substring in a line, but I don't know what that substring is. I do know how the line starts though. For example, DNS1=[...to be replaced....]. I tried: sed -i ...
0
votes
2answers
357 views

Deleting line from file using SED in MultiUser Case

I have a scenario where multiple users are connected to a server using SSH. I have a file which is read and written by all the users. The file contains numbers like this - 14554 14887 23451 15135 ...
0
votes
3answers
245 views

How to manipulate this string of text to make it readable?

I have this string in an excel file: 4603,2504603#;4616,2504616#;4617,2504617#;4519,2504519#;4620,2504620 (It's actually a lot longer than that, but the pattern is the same). I need to be able ...
0
votes
1answer
36 views

Probability of colission when hash is half the size of data?

If i had a password of 100 bits, and hashed it with a hash function that returned a 50 bit key, now i brute force it until a get a string that produces a matching hash, is there now a 50% chance that ...