The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
0answers
2 views

Multiple string replacements at once in MATLAB

I would have expected that the following command strrep('abc', {'a', 'b', 'c'}, {'1', '2', '3'}) returns '123' in MATLAB. It does not; instead, it returns a cell array: ans = '1bc' 'a2c' ...
2
votes
2answers
44k views

How to extract part of a string, in Windows batch file?

If I have a variable in a batch (cmd) file that looks like "Abc_123", and I want to end up with a variable that has just "123", is there any built-in way to do this? I'm not terribly picky about the ...
1
vote
2answers
59 views

How to split a string with quotes (like command arguments) in bash?

I have a string like this: "aString that may haveSpaces IN IT" bar foo "bamboo" "bam boo" I want to be able to split it like this: aString that may haveSpaces IN IT bar foo bamboo bam boo ...
0
votes
1answer
27 views

MS Excel: MIN and FIND/SEARCH

I am trying to figure out what exactly excel is doing with these two functions. I have many rows of strings in a single column. I want to pull out the first numeric in those strings. The first number ...
1
vote
0answers
18 views

Parsing (or Converting) Buffered Output

If a dynamic, text-based, CLI application doesn't include an option for producing unbuffered text output; what options do I have for parsing said output? Can it be converted to a more appropriate ...
1
vote
1answer
25 views

Bash: return all the characters between the nth occurence of two different strings within a string

In a bash script (on Ubuntu 14.04) I'm running the command: WP055="$(wget -qO - http://alerts.weather.gov/cap/wwaatmget.php?x=CAZ055&y=1)" Within the WP055 variable string there will be an ...
0
votes
1answer
26 views

Using 'diff' compare usernames from file1 to file2 containing emails

I am trying to identify active accounts over dead accounts and was wondering if diff along with grep or sed or regex can be used, instead of writing a long program. File1 (usernames) ...
2
votes
3answers
174 views

How to find the common paths from a list of paths/files

Prelude: Given a sorted input of a list of paths/files, how to find their common paths? Translating into tech term, if feeding the sorted input from stdin, how to pick the shortest proper prefix ...
1
vote
3answers
146 views

How to split and distribute columns like “A,B,C” and “X,Y,Z” into “A,X,B,Y,C,Z”?

so this seems tricky to me but i have a set of data that need to be split into alternating comlumns here is what i mean is in the example below i split column A to C E and G ect depending on how many ...
0
votes
0answers
46 views

Bash 4.3 Substring Negative Length on OS X

Bash 4.2 added support for negative substring lengths: http://tldp.org/LDP/abs/html/abs-guide.html#SUBSTREXTR01 Example 37-12. Negative parameter in string-extraction construct When the ...
0
votes
1answer
26 views

Extract the first 2 letters in each line of a file using a single command Terminal

I want to extract the first 2 letters of each line from a file and save it in a variable and print it in a single command. Can anyone help me with the command? Considering my file has 20 - 30 lines ...
2
votes
2answers
1k views

VI make every first letter that comes after a underscore uppercase

Found this site: http://unix.t-a-y-l-o-r.com/VMswitch.html And it works for the first character but my lines are line this this_is_a_string And I would like this This_Is_A_String Any ...
3
votes
2answers
355 views

Extract a Whole Word From String Containing a Specific Letter or Character

I would like to extract only the word from a cell that contains a specific character ("=") within the text. A2: Dolly made me a homemade=cake and some muffins A3: we had cheese=cake for dinner A4: ...
6
votes
5answers
13k views

How to create a random string of random length from the alphabet?

I want to create a random string with random length from the alphabet in Excel. For example, "jlskdjf", "kjlk", "kljsodif", etc. How can I do that?
0
votes
0answers
14 views

Char case variations tool

I am looking for a tool that will create a dictionary with every possible variation of upper and lower cases chars of a phrase. Example: cat Cat CAt CAT cAT caT cAt
0
votes
3answers
285 views

Split folder paths in Excel to return the final folder

I have a single column in Excel which has a file and folder path. e.g. C:\1_Folder\2_Folder\3_Folder\my_file.txt I would like to extract the name of the final folder and place this in a new column. ...
3
votes
2answers
2k views

Replace every nth instance of a character with a new line in Notepad++

I have a pipe delimited string of NAME|VALUE pairs looking something like this.. Name1|Value1|Name2|Value2|Name3|Value3 What I want to do is to replace every second instance of | with a new line so ...
-1
votes
2answers
32 views

Only show part of logfile in bash script

OpenVPN log looks like this: OpenVPN CLIENT LIST Updated,Sat Jun 20 04:20:07 2015 Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since [ A .... ] ROUTING TABLE Virtual Address,Common ...
0
votes
1answer
21 views

Swapping / exchanging two selections in Webstorm

Is there a way of swapping two selections under multiple carets like in sublime-text in the Jetbrains' editors like Webstorm. The default shortcut in sublime text is CTRL+T for the transpose command. ...
0
votes
1answer
115 views

Excel - Look up list of substrings within large strings

I've been struggling with the following; might be a bit of a challenge. I have an Excel file that was exported from an XML application. Sheet 1 contains rows of strings like those below. Every ...
0
votes
0answers
101 views

Replace in file with Huge String (Argument list too long)

I have a file in which I want to replace a string with a huge string literal in the form "19209302","19209329" such 100 thousand of entries. I am using sed and I get "Argument list to long" error, ...
0
votes
4answers
322 views

Powershell parse object / string

Learning powershell, trying to find out how to parse the first value from this resultset: IPAddresses ----------- {10.60.50.40, fe80::5ddf:a8f4:e29c:b66} Normally I would just look it up, however, ...
2
votes
1answer
33 views

Prepending a ‘.’ to each domain name in a list but skip raw IP addresses

We are starting a new proxy server at work and have a list of domains that are to be blocked; the list is downloaded from an external site. To place them in Squid format we have to add a . to the ...
1
vote
2answers
8k views

Find and replace notepad++ with wildcards

I've read about 15 tutorials on regular expression however I'm clearly not getting as I've been unable to tailor it to my problem. I have one set of code which would be found in many different ...
0
votes
2answers
404 views

Notepad++: How to trim strings to a maximum length in a huge file?

community i need your help, please! i want to trim strings in a file with about 900000 lines: KAA BSJDKWLADDKHUEW AJMJJ GMEMJRGUMGA GJWEGRJGJALUSGEUIGRL AGUGADJF WE ..... I Want to trim all ...
1
vote
1answer
291 views

Notepad++ macro for changing a certain part of a string

I want to define a Notepad++ macro that takes any string that contains "foo", and creates its new versions only changing the foo to "bar1", "bar2" etc. so if my file contains abc_foo_def when I ...
0
votes
2answers
31 views

Remove New Line at the beginning and '-' from the contents of file

I have a file with the below output. ---------- PFIZ_EXT_SEAGRCLMHISD_20141013_1.TXT: 165428 ---------- PFIZ_EXT_SEBMODCHKIND_20141013_1.TXT: 0 ---------- ...
1
vote
2answers
139 views

String Manupulation in VBA

I have single column that needs to be split to multiple, like Text-to-columns in excel. However there is a small challenge. Conventional delimiter will not work. Consider the string below Original: ...
0
votes
2answers
78 views

How to find number of `_`-separated words?

I want to make a Unix command that reads a string and counts how many words it contains. In my case the words are separated by a _ (underscore) character, not spaces. For example, TABLE_PERSON ...
0
votes
1answer
508 views

how to extract last number sequence in an IP Address (using Linux)

I want to extract the last digits of an IP Address based on the result of ifconfig command. ifconfig often includes a whole heap of output so I'm not really sure how to get the digits that I want. ...
1
vote
2answers
195 views

Why doesn't grep work with single quotes?

I have a bash script wrapped in " " so I need to use ' ' for my grep command but it doesn't work. I can't switch the quotes because then the variables are not expanded. #!/bin/bash PWD=`pwd` source ...
3
votes
2answers
7k views

function to automatically remove special characters from file names during saving in MacOS X

I'm often creating PDF files from web pages in MacOS X (10.6) and very often I have the problem that the automatically proposed file name (based on the name of the web page) contains many special ...
3
votes
1answer
463 views

How can I do string manipulation in fish shell

How can I do bash style string manipulations in Fish shell? Specifically, in bash read branch < ".git/HEAD" branch=${branch#ref: refs/heads/} will put the branch name in $branch variable. How ...
0
votes
1answer
58 views

Extract part of a cell's text

I have text values in 10's of thousands of cells. I want to pull off the "prefix" and put it in a separate column. We have a delimiter, guaranteed, of a hyphen with spaces around it to help pick off ...
0
votes
1answer
156 views

What SQL can be used to extract a first and last name from a mixture of name fields

Name field can be a mixture of formats, for example: Mr. First Last, Mr First Last, First M Last, First M. Last, First Last Snr, First M Last Snr, First Last-Last, etc.
1
vote
1answer
2k views

How do I append dynamic number of spaces at the end of a string in a batch file

I want to output information to a log file as such 01/08/2013 14:30 - Dynamic-Machine-Name - Message starts 02/08/2013 07:12 - DynamicMachineName - Log entry 02/08/2013 07:14 - ...
0
votes
2answers
450 views

Excel string extract

I have a string in a cell: ABCDxxxxxEFGH ABCD and EFGH are constants, and xxxxx is of variable length. How do I write an Excel formula to extract xxxxx?
2
votes
3answers
509 views

Counting frequency of comma-delimited tags in Excel

I have an excel spreadsheet with a list of seminars and classes that students have taken that (when abridged) looks like: (A)___ClassName________|(B)_________Tags____________| Astrobiology ...
0
votes
0answers
101 views

How to 301 redirect a set of links containing a specific word in a string

I am trying to find a way to redirect http://www.windoorsa.com/products?option=com_virtuemart&page=shop.product_details&only_page=1&product_id=3540&pop=1&tmpl=component& where ...
1
vote
2answers
549 views

How to pass a formula as one of the arguments to CONCATENATE?

I'm using Microsoft Excel 2010 and I am trying to create a title which will be updated every time the spreadsheet is opened. I want it to say "Forecast from (today's date) until end of 2013". So far ...
0
votes
1answer
229 views

Extracting delimited substring in Excel

I started with this question, but it doesn't quite address my needs. I have a series of filenames in a worksheet. Some of the filenames have cross-references enclosed in square brackets. Consider Foul ...
0
votes
1answer
1k views

Delete a character from an argument passed to a batch file

Suppose in a batch file, say receive.bat, is called with some arguments. Now receive.bat executes and it needs to process these arguments. Sometimes (but not always), an argument will end with a ...
12
votes
3answers
49k views

Any Excel function that will reverse a string?

Are there any built-in Excel functions that will reverse a string?
1
vote
2answers
230 views

UNIX string comparing in large file

I have a large text file with over 75 Million records. Each record consists of string tokens (attributes) and between each token there is a tab character. This is an example of two records: 43 ...
3
votes
1answer
162 views

Linux shell scripting: unexpected variable behavior

I have a variable $myvar that contains two lines, and I want to put first of them into a new variable. When I try: $ myvar1 = $(echo $myvar | head -n 1) It doesn't work because echo doesn't ...
1
vote
1answer
2k views

Remove URL Parameter in Excel

I have a URL of the following form: http://www.example.com/page.html?param1=asdf&param2=asdfg&param3=asdfgh I want to extract the value of param2 or 3 from the URL as well as remove that ...
3
votes
2answers
1k views

Bash prefix string with tilde to expand to home directory

I can't figure out how to prefix a string (e.g. "user1") with a tilde (~) to produce ~user1 and have that expand to user1's home directory. Here is what I have now: USER="user1" ls ~${USER} ls: ...
2
votes
1answer
713 views

How to calculate and group the time differences of specified syscalls when running strace

I'm planing to do some web performance testing (to see how much time it's spent for each file), but it could be useful for any application. I exactly know existence and how to use different ...
2
votes
1answer
2k views

Bash string concatenation, do not expand wildcard

Background: I have a script which takes a filename as a parameter, for example "mydb.sql". My script imports this DB and "cleans" it (removes user identifiable data, etc), exports it and then creates ...
1
vote
4answers
514 views

How to extract two numbers from two strings and calculate the difference in Bash?

I have a text file which contains (among others) the following lines: {chapter}{{1}Einleitung}{27}{chapter.1} {chapter}{{2}Grundlagen}{35}{chapter.2} How can I get the 2 lines from this text ...