Questions tagged [string]

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.

Filter by
Sorted by
Tagged with
-1
votes
0answers
13 views

parse function returning wrong date from the string in python 3 [closed]

I am trying to extract date from the string. if the string has exact date, then parse funtion will return correct date from dateutil.parser import parse ExDate = parse("My Birthday is on 28/05/2020",...
0
votes
0answers
14 views

search files containing a certain text/string 'within a given range of the file' [closed]

Is there a 3rd party windows program that can search files containing a certain text within a given range of the file. ex1) Find all files containing 'orange' in the 10th~20th lines the file. ex2) ...
0
votes
0answers
20 views

How to stop Excel from saving .txt files with strings converted to “#########…”?

I need to save an Excel file as a tab-separated .txt file for compatibility with other software. However when I do this, the long strings of text that appear as strings of hash symbols in the UI but ...
0
votes
1answer
99 views

How do you pass a number string to a program in a batch file

I'm making a batch file which runs ffprobe to get the length of a video file. this info is save inside a text file. I can then load that data into my batch file and remove the decimal places from the ...
0
votes
1answer
41 views

windows batch compare then skip utf  in first line of file

I would like list lines of file in batch and, in case of UTF file, skip "" characters in first line. @echo off setlocal EnableExtensions EnableDelayedExpansion for /f "delims=" %%a in (list.txt) ...
0
votes
1answer
67 views

Powershell: evaluate math expression represented as string

In PowerShell, how do I evaluate a mathematical expression stored as a string? How do I get PowerShell to evaluate the following: C:\> $a="30000/1001" C:\> $a 30000/1000 C:\> Desired ...
1
vote
1answer
17 views

Applying -lt on string variables in bash

I am new to bash scripting. I have to compare two values here, $i and $cdsStart: check if $i is lesser than $cdsScript, below is my code for doing the same. inputFile="$1" while read -r ...
1
vote
1answer
26 views

Excel: Function which gives location of a cell containing specific text

I've had a look around on google but have only been able to find formulae for checking whether or not a cell contains a given piece of text, however what I'm looking for is slightly different. I ...
0
votes
1answer
37 views

How to split the not regularly whitespace fields using awk or like others?

I want to split the data as below: $1 $2 $3 $4 $5 $6 $7 $8 ......... -------------------------------------------------------------------------------------------...
0
votes
1answer
49 views

String manipulation - get part after a certain word

Background: Although I think Fail2Ban is great way of securing subsystems like Apache, it takes a lot of work to get all the info together. So I'm writing a BASH script to do that for me. I need to ...
0
votes
1answer
46 views

Excel 2013 - How to remove numbers only from different positions and preceded by different symbols, letters

Is there any formula on Excel 2013 that can be used to remove digits from rows? I want to leave only letters and symbols. The formula needs to work for numbers that can occur at any position, ...
0
votes
1answer
39 views

Return a row if a column has a partial or perfect match with CSV in Powershell

Basically, I want to search for a string and return any full or partial matches in a CSV format. Let's say I have an object $Shoes that looks like: "Brand","Style","Color","Price" "Reebok","...
0
votes
1answer
835 views

What is the << EOF equivalent in powershell

What is the powershell equivalent to the Linux command: tee file.txt <<EOF Where the terminal <input> would be something like: blah blah <\n> beh ble <\n> EOF Let's say ...
0
votes
1answer
27 views

Extract MID between characters, but from second instance in Excel

I need to isolate the middle string of text from a line. The number which follows the "Q." "400" When I pull the MID section, it grabs everything from the FIRST "S" to the end of the "Q400" ...
0
votes
1answer
37 views

Replacing lots of text with a string from the same line in one file

I have this: TEXT_CONNECTED "You're connected." TEXT_DISCONNECTED "You're disconnected." and many more. TEXT_CONNECTED and TEXT_DISCONNECTED are also used elsewhere in the same file, like: ...
0
votes
1answer
267 views

In Bash how to get the position of a substring, within a string, starting the search at character position n

I am new to Bash scripting, I've used Visual Basic in Windows before and am looking for a bash equivalent string function for VB's inStr(). example in VB : strMain = "abcABC123ABCabc" searchStartPos ...
0
votes
2answers
242 views

Can we store a whole string with the help of a single character pointer? If yes , How? [closed]

Here p is a character pointer not an array! Yet compiler gave no warning or error? char *p = "Vladimir";
0
votes
1answer
41 views

How can I use Regex to determine if a string has either a number, equation symbols, or a period in it?

I created this new custom console api while I was bored, and I created a feature which allows you to change a variables value. If your curious about the console api, heres a live pen: https://codepen....
0
votes
4answers
134 views

How do I set a column of numbers to have same length (string) of character in Microsoft Excel when some of those numbers are negative and decimal?

Let's say I have a list of the following numbers: 97.24 73.25 -28.66 -52.75 -74.83 -234.43 -209.85 176.64 -163.34 -398.64 -3.73 -75.16 How would I align them in a column such that they ...
0
votes
2answers
752 views

How to reverse a string in Excel?

Is there an Excel function (or macro) I can use to reverse a string. i.e. to turn these words into sdrow eseht? Here is why I need that: My strings are similar to John|XYZ Street|215|USA and I need ...
0
votes
1answer
39 views

Add multiline string after specific string

I´m trying to insert a multi-line string in a file after a specific string was found. I already searched and tried a lot of options, but none of them returned the result I expected. Here is the block ...
0
votes
1answer
229 views

Xcode console input not matching output C++

I'm experiencing some weird problem writing C++ code in Xcode on a MacBook. I know the code isn't faulty as I have had windows users run it with no problems at all, but somehow the output I get is not ...
0
votes
2answers
42 views

Remove last character from first word in excel

I need to remove the last character from first word in excel. For example I have the cell B1 with "Teas from Spain" and I need cell A1 to be "Tea from Spain". Thank you
0
votes
1answer
722 views

batch that change particular string on a .txt file [duplicate]

I have a example.txt witch contanins: [DDRAWSINK] PlaybackDisp=0 Fullscreen=0 CurUsage=2 PlaybackRes=0 ForceRender=0 DV Output On=0 DV Preview VGA=0 DV Port=0 single lines can have only 1 ...
0
votes
1answer
5k views

Searching for *exact* string on Google or other search engines [closed]

Google advanced search says that to search for an exact word or phrase, put the word or phrase in quotations, e.g. "rat terrier" However this doesn't work the way I want/expected for certain kinds of ...
2
votes
1answer
486 views

Wrong string concatenation using Bash Windows Subsystem

I'm having headaches to know why my script doesn't work as expected under windows subsystem linux. My version from the store : Debian GNU/Linux 9.6 (stretch) (I tried ubuntu too, with the same ...
2
votes
1answer
486 views

Find position of first uppercase character in excel string

I need to find the position of the first uppercase character in an Excel string. There are lots of resources on the web that have the same (or effectively the same) solution for this: =MIN(IF(ISERROR(...
2
votes
3answers
626 views

Extract and SUM numbers from a string

I have looked at the similar questions to this but could not find an exact solution to my problem. If there is a duplicate which can solve this I will close this question. In cell A1 I could have a ...
0
votes
1answer
31 views

Cut 4 digits from AD DisplayName

I have googled and used the PS help as much as possible but can't find a definitive resolution to the seemingly small issues that I have. My users have [ZZ] at the end of their displayName of their ...
0
votes
1answer
527 views

Extracting SharePoint data on daily basis

I want to export my SharePoint document library data on daily basis and csv file need to be save as naming convention as Dataname_yyyyMMdd. As per my below script, it need to export data from the ...
0
votes
2answers
176 views

Extract Text from in front of, after, and inside characters

I have a variable (%~1) set to something like: Hello there this is a block: [C]Inside of Block[/C] Did you like it? I want to have it separated into three variables: Front=hello there this is a ...
0
votes
1answer
565 views

extract data from SharePoint document library to CSV using powershell

I am trying extract data of SharePoint document library to CSV file using powershell. I am getting data correct on CSv file. But one column i.e "Description" have more text data on it.So when run the ...
0
votes
1answer
321 views

Hashtags are coming when export data to CSV file by powershell script

I am running a powershell script for getting data from SharePoint document library. While run the script, data came to csv file, but columns names are coming with ";#" hashtags. For example, names, ...
1
vote
1answer
2k views

Equivalent of a wildcard in find for batch?

I'm almost certain this is a duplicate but I was unable to find it after a lot of searching so forgive me. I'm looking for a way to have the equivalent of a wildcard in the find command. For ...
1
vote
1answer
38 views

How to extract multiple urls from String?

I have a string like below https://website.com/BTAE/2015/BTAE assignment jan 15.pdf²0ÔË'\„QI„"ÙP¾^ŒŸZ‡@Æ*]Ü.^‚vðƒ€Ù¾»Æš©Šñ‘€é• ªÂIR#œÉgÉÛ^gMdÉ%9¬e˜Hžôb¿'0<ô ?lþzk…éÃÄórÈ;EW¦K³1…²ì¶ZFžŠÒô*ÄÖ\...
1
vote
1answer
314 views

Find the part of the string that distinguishes a string in one cell from a string in another cell

I have two columns with strings and want to know which parts of the string from one column has with the other column. I have checked this solution Compare 2 text cells and show difference in the third ...
1
vote
2answers
44 views

When to use \ in grep search string

I have file content similar to: A+B C+D A+B These are strings. I want to search for the occurrence of A+B. So I write the command as: grep 'A+B' test.txt. However, if I write grep 'A\+B' test.txt I ...
0
votes
1answer
192 views

Logical AND and OR with grep

I want to extract the lines that matches the following logical operation: "AB+CD" AND ("nonAB+nonCD" OR "nonAB+CD"). Which means I want lines with: AB+CD,nonAB+nonCD AB+CD,nonAB+CD AB+CD,nonAB+...
0
votes
1answer
823 views

How to compare two columns of two different files

I have two file.The first one contains something like: a.com,5,some,text b.com,10,some,text c.com,5,some,text d.com,12,some,text e.com,5,some,text c.com,5,some,text The second contains something ...
0
votes
2answers
3k views

How to start searching from second column using grep command

I have a file contains string like the following: site1.com,Level1.2 site2.com,Level1.1,Level1.0,Level1.2 site3.com,Level1.2 site4.com,Level1.2,Level1.1,Level1.0,Levelv3 siteLevel1.2,Levelv2 Level1.2,...
0
votes
1answer
206 views

How would I pipe a command to grep to search for a certain string, when part of that string is unknown?

The program I am working on makes use of grep to search a system log for a particular alert, however the an element of the syslog entry I am looking for will pertain specifically to that entry, and ...
1
vote
2answers
787 views

Count occurrences of a string in a cell

I have an Excel file containing a piece of HTML code in a cell: <li>item 1</li><li>item 2</li><li>item 3</li> Now I want to count the occurrences of the string "&...
0
votes
1answer
2k views

Batch script to fetch each line from a .txt file as a string (more than one word in a line) and google search each string in a separate tab in chrome

I've a controlfile.txt file in which I have some softwares names in each line, e.g. "Microsoft Office" in first line, then "Autodesk AutoCAD" in second line, "Adobe Acrobat Reader" in third line and ...
0
votes
0answers
33 views

Adding numbers in some cells of a table

Given an ASCII text file on a generic Unix/Linux system that looks like: | 0.9 | 0.6 | 8+1 | ... ... How can I replace the expressions with their values, for example, replace 8+1 with 9? ...
0
votes
2answers
941 views

How to parse multi-line log file in awk and output only single line with last known ip address

I am stuck and looking for assistance. I want to trigger an event which I'd like to process further through a bash script. The data is retrieved from a log file. Before I start to explain I'll show ...
0
votes
2answers
681 views

How to convert a string of comma-separated values into an array

I have a several cells with strings such as this one: "John,Carla,Peter,John,Bob,Chris,Carla,Andrea" I would like to count how many different people are named (i.e. how many unique values). The ...
0
votes
2answers
2k views

How to trim text before specifc character using notepad++

I have a file each line look like "J001.C1086" "JH001.Blend 10-111". I need to remove the leter/number before each . after remove, it look like "C1086" "Blend 10-111" Thanks!!
4
votes
1answer
309 views

How do I properly escape '=' in my string replacement script?

I have made a batch script that replaces strings in a specified text-based file. Within my file, the string OutDir=bin should be replaced as OutDir=Build but gets output as bin=OutDir=Build=bin. How ...
4
votes
2answers
21k views

Insert quote into string variable in bash

Is there way of inserting a quote at the start and end into a string variable? I have this variable say: string="desktop/first folder" If I echo this, it will display: desktop/first folder I need ...
3
votes
1answer
28 views

Excel: How to assign value to txt and sum

I have a file with several football player ratings: ***, **, * or x. *** means a performance of 3, **= 2; *= 1 and x if the player didn't play. I want to have a sum at the end of the row to see the ...