Search Results

Search found 36131 results on 1446 pages for 'text manipulation'.

Page 5/1446 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • implementation of text editor in shell programming

    - by Arka Ghosh
    i have made a text editor in C. when i am changing the extension of that file from .c to .sh and compiling the file in the terminal,some error is shown,like for the global variables an external error is shown,and for the functions i have declared errors are shown there also.please help me to solve this. I am sending my code.. include include include int i,j,ec,fg,ec2; char fn[20],e,c,d; FILE *fp1,*fp2,fp; void Create(); void Append(); void Delete(); void Display(); int main() { do { printf("\n\t\t** TEXT EDITOR *"); printf("\n\n\tMENU:\n\t..\n "); printf("\n\t1.CREATE\n\t2.DISPLAY\n\t3.APPEND\n\t4.DELETE\n\t5.EXIT\n"); printf("\n\tEnter your choice: "); scanf("%d",&ec); switch(ec) { case 1: Create(); break; case 2: Display(); break; case 3: Append(); break; case 4: Delete(); break; case 5: exit(1); } }while(1); } void Create() { fp1=fopen("temp.txt","w"); printf("\n\tEnter the text and press '.' to save\n\n\t"); while(1) { c=getchar(); fputc(c,fp1); if(c == '.') { fclose(fp1); printf("\n\tEnter then new filename: "); scanf("%s",fn); fp1=fopen("temp.txt","r"); fp2=fopen(fn,"w"); while(!feof(fp1)) { c=getc(fp1); putc(c,fp2); } fclose(fp2); break; }} } void Display() { printf("\n\tEnter the file name: "); scanf("%s",fn); fp1=fopen(fn,"r"); if(fp1==NULL) { printf("\n\tFile not found!"); goto end1; } while(!feof(fp1)) { c=getc(fp1); printf("%c",c); } end1: fclose(fp1); printf("\n\n\tPress any key to continue.."); } void Delete() { printf("\n\tEnter the file name: "); scanf("%s",fn); fp1=fopen(fn,"r"); if(fp1==NULL) { printf("\n\tFile not found!"); goto end2; } fclose(fp1); if(remove(fn)==0) { printf("\n\n\tFile has been deleted successfully!"); goto end2; } else printf("\n\tError!\n"); end2: printf("\n\n\tPress any key to continue.."); getchar(); } void Append() { printf("\n\tEnter the file name: "); scanf("%s",fn); fp1=fopen(fn,"r"); if(fp1==NULL) { printf("\n\tFile not found!"); goto end3; } while(!feof(fp1)) { c=getc(fp1); printf("%c",c); } fclose(fp1); printf("\n\tType the text and press 'Ctrl+s' to append.\n"); fp1=fopen(fn,"a"); while(1) { c=getchar(); if(c==19) goto end3; if(c==13) { d='\n'; fputc(d,fp1); } else { fputc(c,fp1); } } end3: fclose(fp1); }

    Read the article

  • Error installing Package Control for Sublime Text 3 on Ubuntu 14.04

    - by user1837378
    This is the error. It comes up when I paste and enter the installation code (which I get from the Package Control website) and each time I open up Sublime Text. Package Control Your system's locale is set to a value that can not handle non-ASCII characters. Package Control can not properly work unless this is fixed. On Linux, please reference your distribution's docs for information on properly setting the LANG environmental variable. As a temporary work-around, you can launch Sublime Text from the terminal with: LANG=en_US.UTF-8 sublime_text I had the same problem with Ubuntu 13.04 so it's probably not version-dependent.

    Read the article

  • Help with string manipulation function

    - by MusiGenesis
    I have a set of strings that contain within them one or more question marks delimited by a comma, a comma plus one or more spaces, or potentially both. So these strings are all possible: BOB AND ? BOB AND ?,?,?,?,? BOB AND ?, ?, ? ,? BOB AND ?,? , ?,? ?, ? ,? AND BOB I need to replace the question marks with @P#, so that the above samples would become: BOB AND @P1 BOB AND @P1,@P2,@P3,@P4,@P5 BOB AND @P1,@P2,@P3,@P4 BOB AND @P1,@P2,@P3,@P4 @P1,@P2,@P3 AND BOB What's the best way to do this without regex or Linq?

    Read the article

  • PDF Manipulation with Adobe's Form Input Fields

    - by Justin
    Hello, I am trying to simplify a process where I currently use my hand calculations of X & Y Co-Ordinates of each value. Which works fine, but is causing me a lot of pain as I have to do quite a number of PDF's. I know that I can open a PDF and insert "input fields" within Adobe Acrobat Pro, which it would be great if I could use PHP to connect to those input fields and insert a value from a PHP Form. WORKFLOW:: PHP FORM PHP PROCESSING ENGINE TO FINAL PDF WITH FORM VALUES IN THE LOCATION OF THE ADOBE INPUT FIELDS. If someone has some information on something like this it would be much appreciated.

    Read the article

  • Regarding String manipulation

    - by arav
    I have a String str which can have list of values like below. I want the first letter in the string to be uppercase and if underscore appears in the string then i need to remove it and need to make the letter after it as upper case. The rest all letter i want it to be lower case. "" "abc" "abc_def" "Abc_def_Ghi12_abd" "abc__de" "_" Output: "" "Abc" "AbcDef" "AbcDefGhi12Abd" "AbcDe" ""

    Read the article

  • [jQuery] [PHP] Image manipulation

    - by robertdd
    hello, I want to do some kind of image editor, after I upload more images i want to make a list with all the thumbnails! after i want to be able to click on one thumb and rotate, duplicate, drag and drop (to change positions of the images), delete the image! all the images i want to be in a php array, if a image is deleted i want to delete the row from array to, if a image is drag and droped i want to change the position in the array to! ok after the user upload all the images and modify some of it how i can make a DONE button to save the positions of the images? for this small project how u suggest me to save the images? (to make a table in mysql and store the names of the images in the database depending on the session id? depending on the IP? any suggestions are welcome! thanks!

    Read the article

  • jQuery filename manipulation

    - by Adi
    Hi all, I am trying to do a fancy blur/fade effect (which means i need 2 images) but I only want to load 1 in the HTML (in case js is not active) and add the other filename via jQuery (copying and renaming the file/src) The pure html is along the lines of: <div id="work"> <div> <img src="css/images/abc1.jpg" width="360" height="227" alt="" /> </div> <div> <img src="css/images/xyz1.jpg" width="360" height="227" alt="" /> </div> </div> But the html after jquery has manipulated the DOM needs to be like: <div id="work"> <div> <img src="css/images/abc0.jpg" width="360" height="227" alt="" /> <img src="css/images/abc1.jpg" width="360" height="227" alt="" /> </div> <div> <img src="css/images/xyz0.jpg" width="360" height="227" alt="" /> <img src="css/images/xyz1.jpg" width="360" height="227" alt="" /> </div> </div> The question is, what is the jQuery to clone/copy the relative images and then rename the src? Any help would be much appreicated. A.

    Read the article

  • PHP string manipulation, inside the string

    - by James
    I have string: ABCDEFGHIJK And I have two arrays of positions in that string that I want to insert different things to. Array ( [0] => 0 [1] => 5 ) Array ( [0] => 7 [1] => 9 ) Which if I decided to add the # character and the = character, it'd produce: #ABCDE=FG#HI=JK Is there any way I can do this without a complicated set of substr? Also, # and = need to be variables that can be of any length, not just one character.

    Read the article

  • Learning C bit manipulation

    - by VaioIsBorn
    I didn't know any better name for a title of the question. For ex: on one of my previous questions one answered ((a)-(b))&0x80000000) 31 - this is kind of a too advanced for me and i can't really get what it means. I am not looking just for an answer of that, but i need someone to tell me some books/sites/whatever where i can learn this cool "advanced" tricks in C - and learn how and where to use them respectively too.

    Read the article

  • A Simple PHP Array Manipulation

    - by Ygam
    Hi guys! how would you turn this array: array( 0 => Title1, 1 => Title2, 3 => Address1, 4 => Address2, ) to this array: array ( 0 => array( 'title' => 'Title1' 'address' =>'Address1' ), 1 => array( 'title' => 'Title2', 'address' => 'Address2' ) ); when you were initially given $_POST['title'] = array('Title1', 'Title2); $_POST['address'] = array('Address1', 'Address2'); which when merged would give you the first array I have given I was able to solve this via a high level Arr:Rotate function in Kohana framework, along with Arr::merge function but I can't quite understand the implementation. Please help

    Read the article

  • jquery - dom manipulation

    - by grega g
    I would like to show in dialog all elements with specific class. The dialog should hide the rest of the page. So for example: On this SO page I want to show all elements with class="user-info". Those elements would be shown in dialog with same width and height and same css and everything else would be hidden. It would be like cutting them out of the page and pasting them in a dialog. Any ideas how this could be done?

    Read the article

  • Having trouble using 'AND' in CONTAINSTABLE SQL SERVER FULL TEXT SEARCH

    - by Joshua
    I've been using FULL-TEXT for awhile but I cannot seem to get the most relevant results sometimes. If I have an field with something like "An Overview of Pain Medicine 5/12/2006" and a user types "An Overview 5/12/2006" So we create a search like: '"An" AND "Overview" AND "5/12/2006"' - 0 results (bad) '"Overview" AND "5/12/2006"' - 1 result (good) The CONTAINSTABLE portion of my query: FROM ce_Activity A INNER JOIN CONTAINSTABLE(View_Activities,(Searchable), @Search) AS KeyTbl ON A.ActivityID = KeyTbl.[KEY] "Searchable" is a field contains the activity title, and start date(converted to string) in one field so it's all search friendly. Why would this happen?

    Read the article

  • Replace in place, parsing & string manipulation.

    - by Mark Tomlin
    I'm trying to replace a set of characters within a string. The string may or may not have any data to change. The string is marked up in a way that allows for it to change it's color from a set of characters. The string can reset it's it's formatting to default by using a defined set of characters. This setup is very much like the ECMA-48 standard used on LINUX consoles for colors and other special effects. Where one string could be ^0Black^1Red^2Green^3Yellow^4Blue^5Purple^6Cyan^7White Producing the following HTML: <span style="color: #000">Black</span><span style="color: #F00">Red</span><span style="color: #0F0">Green</span><span style="color: #FF0">Yellow</span><span style="color: #00F">Blue</span><span style="color: #F0F">Purple</span><span style="color: #0FF">Cyan</span><span style="color: #FFF">White</span> Another string (^1Error^8: ^3User Error) could also produce: <span style="color: #F00">Error</span>: <span style="color: #FF0">User Error</span> You might of noticed the ^8 part of that string resets the color for that part of the string. What's the best way to go about parsing these kinds of strings?

    Read the article

  • Bit manipulation, permutate bits

    - by triktae
    Hi. I am trying to make a loop that loops through all different integers where exactly 10 of the last 40 bits are set high, the rest set low. The reason is that I have a map with 40 different values, and I want to sum all different ways ten of these values can be multiplied. (This is just out of curiosity, so it's really the "bitmanip"-loop that is of interest, not the sum as such.) If I were to do this with e.g. 2 out of 4 bits, it would be easy to set all manually, 0011 = 7, 0101 = 5, 1001 = 9, 0110 = 6, 1010 = 10, 1100 = 12, but with 10 out of 40 I can't seem to find a method to generate these effectively. I tried, starting with 1023 ( = 1111111111 in binary), finding a good way to manipulate this, but with no success. I've been trying to do this in C++, but it's really the general method(if any) that is of interest. I did some googling, but with little success, if anyone has a good link, that would of course be appreciated too. :)

    Read the article

  • Ruby delete method (string manipulation)

    - by brianheys
    I'm new to Ruby, and have been working my way through Mr Neighborly's Humble Little Ruby Guide. There have been a few typos in the code examples along the way, but I've always managed to work out what's wrong and subsequently fix it - until now! This is really basic, but I can't get the following example to work on Mac OS X (Snow Leopard): gone = "Got gone fool!" puts "Original: " + gone gone.delete!("o", "r-v") puts "deleted: " + gone Output I'm expecting is: Original: Got gone fool! deleted: G gne fl! Output I actually get is: Original: Got gone fool! deleted: Got gone fool! The delete! method doesn't seem to have had any effect. Can anyone shed any light on what's going wrong here? :-\

    Read the article

  • vb.net one dimensional string array manipulation difficulty

    - by Luay
    Hi, I am having some problems with manipulating a one dimensional string array in vb.net and would like your assistance please. My objective is to get 4 variables (if possible) from a file path. these variables are: myCountry, myCity, myStreet, Filename. All declared as string. The file location is also declared as string. so I have: Dim filePath As String to illustrate my problem and what I am trying to do I have the following examples: 1- C:\my\location\is\UK\Birmingham\Summer Road\this house.txt. In this example myCountry would be= UK. myCity= Birmingham. myStreet=Summer Road. Filename=this house.txt 2- C:\my Location\is\France\Lyon\that house.txt. here myCountry=France. myCity=Lyon. There is no street. Filename=that house.txt 3- C:\my Location is\Germany\the other house.txt Here myCountry=Germany. No city. No street. Filename=the other house.txt What I am trying to say is I have no idea before hand about the lenght of the string or the position of the variables I want. I also don't know if I am going to find/get a city or street name in the path. However I do now that i will get myCountry and it will be one of 5 options: UK, France, Germany, Spain, Italy. To tackle my problem, the first thing I did was Dim pathArr() As String = filePath.Split("\") to get the FileName I did: FileName = pathArr.Last To get myCountry I did: If filePath.Contains("UK") Then myCountry = "UK" ElseIf filePath.Contains("France") Then myCountry = "France" ElseIf filePath.Contains("Germany") Then myCountry = "Germany" ElseIf filePath.Contains("Spain") Then myCountry = "Spain" ElseIf filePath.Contains("Italy") Then myCountry = "Italy" End If in trying to figure out myCity and myStreet (and whether they exist in the string in the first place) I started with: Dim ind As Integer = Array.IndexOf(pathArr, myCountry) to get the index of the myCountry string. I thought I could make my way from there but I am stuck and don't know what to do next. Any help will be appreciated. Thanks

    Read the article

  • How to extract common / significant phrases from a series of text entries

    - by arronsky
    I have a series of text items- raw HTML from a MYSQL database. I want to find the most common phrases in these entries (not the single most common phrase, and ideally, not enforcing word-for-word matching). My example is any review on Yelp.com, that shows 3 snippets from hundreds of reviews of a given restaurant, in the format: "Try the hamburger" (in 44 reviews) e.g., the "Review Highlights" section of this page: http://www.yelp.com/biz/sushi-gen-los-angeles/ I have NLTK installed and I've played around with it a bit, but am honestly overwhelmed by the options. This seems like a rather common problem and I haven't been able to find a straightforward solution by searching here. Thanks in advance for any help.

    Read the article

  • String Manipulation: Spliting Delimitted Data

    - by Milli Szabo
    I need to split some info from a asterisk delimitted data. Data Format: NAME*ADRESS LINE1*ADDRESS LINE2 Rules: 1. Name should be always present 2. Address Line 1 and 2 might not be 3. There should be always three asterisks. Samples: MR JONES A ORTEGA*ADDRESS 1*ADDRESS2* Name: MR JONES A ORTEGA Address Line1: ADDRESS 1 Address Line2: ADDRESS 2 A PAUL*ADDR1** Name: A PAUL Address Line1: ADDR1 Address Line2: Not Given My algo is: 1. Iterate through the characters in the line 2. Store all chars in a temp variables until first * is found. Reject the data if no char is found before first occurence of asterisk. If some chars found, use it as the name. 3. Same as step 2 for finding address line 1 and 2 except that this won't reject the data if no char is found My algo looks ugly. The code looks uglier. Spliting using //* doesn't work either since name can be replaced with address line 1 If the data is *Address 1*Address2, split will create two indexes in the array where index 0 will have the value of Address 1 and index 2 will have the value of Address2. Where's the name. Was there a name? Any suggestion?

    Read the article

  • manipulating strings, search text

    - by alhambraeidos
    Hi all, I try explain my issue: note 1: I have only strings, not files, ONLY strings. I have a string like this (NOTE: I include line numbers for better explain) The line separator is \r\n (CRLF) string allText = 1 Lorem ipsum Lorem ipsum 2 == START 001partXXX.sql == 3 Lorem ipsum TEXT Lorem ipsum 4 == END 001partXXX.sql == 5 Lorem ipsum TEXT Lorem ipsum 6 == START 002partzzz.sql == 7 Lorem ipsum TEXT Lorem ipsum 8 == END 002partzzz.sql == I have contents strings like this: string contents1 = == START 001partXXX.sql == Lorem ipsum TEXT Lorem ipsum == END 001partXXX.sql == the other content string: string contents2 = == START 002partzzz.sql == Lorem ipsum TEXT Lorem ipsum == END 002partzzz.sql == Then, allText.IndexOf(contents1) != -1 allText.IndexOf(contents2) != -1 I need function thats receive 3 parameters: allText, Contents, and text to find in contents, and it returns the line number of Text To Find in AllText For example, input: allText, contents2, "TEXT" ouput = line number 7 Another sample, input: allText, contents1, "TEXT" ouput = line number 3 Another sample, input: allText, contents1, "TEXT NOT FOUND" ouput = line number -1 How can I implement this function ?? any help very useful for me, Thanks in advanced.

    Read the article

  • Extracting Demographic and Contact Information from unstructured text files

    - by jn29098
    I am looking to extract specific items out of a large pool of unstructured documents. These documents could be 1-5 pages of text formatted in various ways by the user, but in most cases would contain at least: Name Address (physical) Email Address Phone number website URL I'm looking for a semantic parser that can attempt to extract these elements from the documents so that I can load that information into a relational database and work with these records as contacts. Other services I've looked for, while valuable for other purposes, do not address this specific need. Alchemy API Open Calais Saplo Any thoughts, suggestions or leads?

    Read the article

  • Image manipulation with JQuery and PHP

    - by robertdd
    I want to do some kind of image editor, after I upload more images I want to make a list with all the thumbnails! After, I want to be able to click on one thumb and rotate, duplicate, drag and drop (to change positions of the images), and delete the image. I want all the images to be in a php array. If an image is deleted I want to delete the row from array too. If a image is drag-and-dropped I want to change the position in the array too. Ok, after the user uploads all the images and modifies some of them, how can I make a DONE button to save the positions of the images? For this small project how do you suggest I save the images? (to make a table in mysql and store the names of the images in the database depending on the session id? depending on the IP?) Any suggestions are welcome!

    Read the article

  • String Manipulation: Splitting Delimitted Data

    - by Milli Szabo
    I need to split some info from a asterisk delimitted data. Data Format: NAME*ADRESS LINE1*ADDRESS LINE2 Rules: 1. Name should be always present 2. Address Line 1 and 2 might not be 3. There should be always three asterisks. Samples: MR JONES A ORTEGA*ADDRESS 1*ADDRESS2* Name: MR JONES A ORTEGA Address Line1: ADDRESS 1 Address Line2: ADDRESS 2 A PAUL*ADDR1** Name: A PAUL Address Line1: ADDR1 Address Line2: Not Given My algo is: 1. Iterate through the characters in the line 2. Store all chars in a temp variables until first * is found. Reject the data if no char is found before first occurence of asterisk. If some chars found, use it as the name. 3. Same as step 2 for finding address line 1 and 2 except that this won't reject the data if no char is found My algo looks ugly. The code looks uglier. Spliting using //* doesn't work either since name can be replaced with address line 1 if the data was *Address 1*Address2. Any suggestion?

    Read the article

  • String manipulation in Linux kernel module

    - by user577066
    I am having a hard time in manipulating strings while writing module for linux. My problem is that I have a int Array[10] with different values in it. I need to produce a string to be able send to the buffer in my_read procedure. If my array is {0,1,112,20,4,0,0,0,0,0} then my output should be: 0:(0) 1:-(1) 2:-------------------------------------------------------------------------------------------------------(112) 3:--------------------(20) 4:----(4) 5:(0) 6:(0) 7:(0) 8:(0) 9:(0) when I try to place the above strings in char[] arrays some how weird characters end up there here is the code int my_read (char *page, char **start, off_t off, int count, int *eof, void *data) { int len; if (off > 0){ *eof =1; return 0; } /* get process tree */ int task_dep=0; /* depth of a task from INIT*/ get_task_tree(&init_task,task_dep); char tmp[1024]; char A[ProcPerDepth[0]],B[ProcPerDepth[1]],C[ProcPerDepth[2]],D[ProcPerDepth[3]],E[ProcPerDepth[4]],F[ProcPerDepth[5]],G[ProcPerDepth[6]],H[ProcPerDepth[7]],I[ProcPerDepth[8]],J[ProcPerDepth[9]]; int i=0; for (i=0;i<1024;i++){ tmp[i]='\0';} memset(A, '\0', sizeof(A));memset(B, '\0', sizeof(B));memset(C, '\0', sizeof(C)); memset(D, '\0', sizeof(D));memset(E, '\0', sizeof(E));memset(F, '\0', sizeof(F)); memset(G, '\0', sizeof(G));memset(H, '\0', sizeof(H));memset(I, '\0', sizeof(I));memset(J, '\0', sizeof(J)); printk("A:%s\nB:%s\nC:%s\nD:%s\nE:%s\nF:%s\nG:%s\nH:%s\nI:%s\nJ:%s\n",A,B,C,D,E,F,G,H,I,J); memset(A,'-',sizeof(A)); memset(B,'-',sizeof(B)); memset(C,'-',sizeof(C)); memset(D,'-',sizeof(D)); memset(E,'-',sizeof(E)); memset(F,'-',sizeof(F)); memset(G,'-',sizeof(G)); memset(H,'-',sizeof(H)); memset(I,'-',sizeof(I)); memset(J,'-',sizeof(J)); printk("A:%s\nB:%s\nC:%s\nD:%s\nE:%s\nF:%s\nG:%s\nH:%s\nI:%s\nJ:%\n",A,B,C,D,E,F,G,H,I,J); len = sprintf(page,"0:%s(%d)\n1:%s(%d)\n2:%s(%d)\n3:%s(%d)\n4:%s(%d)\n5:%s(%d)\n6:%s(%d)\n7:%s(%d)\n8:%s(%d)\n9:%s(%d)\n",A,ProcPerDepth[0],B,ProcPerDepth[1],C,ProcPerDepth[2],D,ProcPerDepth[3],E,ProcPerDepth[4],F,ProcPerDepth[5],G,ProcPerDepth[6],H,ProcPerDepth[7],I,ProcPerDepth[8],J,ProcPerDepth[9]); return len; }

    Read the article

  • Performance intensive string splitting and manipulation in java

    - by juhanic
    What is the most efficient way to split a string by a very simple separator? Some background: I am porting a function I wrote in C with a bunch of pointer arithmetic to java and it is incredibly slow(After some optimisation still 5* slower). Having profiled it, it turns out a lot of that overhead is in String.split The function in question takes a host name or ip address and makes it generic: 123.123.123.123-*.123.123.123 a.b.c.example.com-*.example.com This can be run over several million items on a regular basis, so performance is an issue.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >